mirror O_APPEND and O_DIRECT into iocb->ki_flags

... avoiding write_iter/fcntl races.

Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Al Viro 2015-04-09 13:52:01 -04:00
commit 2ba48ce513
11 changed files with 38 additions and 23 deletions

View file

@ -1177,7 +1177,7 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
if (err)
goto out;
if (file->f_flags & O_DIRECT) {
if (iocb->ki_flags & IOCB_DIRECT) {
loff_t pos = iocb->ki_pos;
written = generic_file_direct_write(iocb, from, pos);
if (written < 0 || !iov_iter_count(from))