author: Linus Torvalds <torvalds@linux-foundation.org> 2014-03-03 09:36:58 -0800
committer: Al Viro <viro@zeniv.linux.org.uk> 2014-03-10 11:44:41 -0400
commit: 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4
parent: 1b56e98990bcdbb20b9fab163654b9315bf158e8
Commit Summary:
Diffstat:
1 file changed, 4 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c
index 4b3e1edf2fe4..b9ed8b25c108 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -705,6 +705,10 @@ static int do_dentry_open(struct file *f,
return 0;
}
+ /* POSIX.1-2008/SUSv4 Section XSI 2.9.7 */
+ if (S_ISREG(inode->i_mode))
+ f->f_mode |= FMODE_ATOMIC_POS;
+
f->f_op = fops_get(inode->i_fop);
if (unlikely(WARN_ON(!f->f_op))) {
error = -ENODEV;