mirror O_APPEND and O_DIRECT into iocb->ki_flags
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Apr 2015 17:52:01 +0000 (13:52 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:30:22 +0000 (22:30 -0400)
... avoiding write_iter/fcntl races.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/aio.c
fs/btrfs/file.c
fs/ceph/file.c
fs/ext4/file.c
fs/fuse/file.c
fs/gfs2/file.c
fs/nfs/file.c
fs/ocfs2/file.c
fs/xfs/xfs_file.c
include/linux/fs.h
mm/filemap.c

index 5785c4b..e976185 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1502,7 +1502,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
        }
        req->common.ki_pos = iocb->aio_offset;
        req->common.ki_complete = aio_complete;
-       req->common.ki_flags = 0;
+       req->common.ki_flags = iocb_flags(req->common.ki_filp);
 
        if (iocb->aio_flags & IOCB_FLAG_RESFD) {
                /*
diff --cc fs/btrfs/file.c
Simple merge
diff --cc fs/ceph/file.c
Simple merge
diff --cc fs/ext4/file.c
Simple merge
diff --cc fs/fuse/file.c
Simple merge
diff --cc fs/gfs2/file.c
Simple merge
diff --cc fs/nfs/file.c
Simple merge
diff --cc fs/ocfs2/file.c
Simple merge
Simple merge
Simple merge
diff --cc mm/filemap.c
Simple merge