diff options
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 96d513e01a5d..126deb5d0a9c 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1235,15 +1235,13 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1235 | goto out; | 1235 | goto out; |
1236 | 1236 | ||
1237 | if (file->f_flags & O_DIRECT) { | 1237 | if (file->f_flags & O_DIRECT) { |
1238 | written = generic_file_direct_write(iocb, iov, &nr_segs, pos, | 1238 | iov_iter_init(&i, iov, nr_segs, count, 0); |
1239 | count, ocount); | 1239 | written = generic_file_direct_write(iocb, &i, pos, count, ocount); |
1240 | if (written < 0 || written == count) | 1240 | if (written < 0 || written == count) |
1241 | goto out; | 1241 | goto out; |
1242 | 1242 | ||
1243 | pos += written; | 1243 | pos += written; |
1244 | count -= written; | ||
1245 | 1244 | ||
1246 | iov_iter_init(&i, iov, nr_segs, count, written); | ||
1247 | written_buffered = fuse_perform_write(file, mapping, &i, pos); | 1245 | written_buffered = fuse_perform_write(file, mapping, &i, pos); |
1248 | if (written_buffered < 0) { | 1246 | if (written_buffered < 0) { |
1249 | err = written_buffered; | 1247 | err = written_buffered; |