diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-07 15:06:19 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:29:50 -0400 |
commit | 6b775b18eecf60b8a44723e05f8eb6251b71a7a9 (patch) | |
tree | 00e1319bffaa949fc9de7134a5afe41728b5bc7e /fs | |
parent | e768d7ff7b923a74a019d8782e6ee75dc1de12c1 (diff) |
fuse: ->direct_IO() doesn't need generic_write_checks()
already done by caller. We used to call __fuse_direct_write(), which
called generic_write_checks(); now the former got expanded, bringing
the latter to the surface. It used to be called all along and calling
it from there had been wrong all along...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/file.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 4c04a8144a75..8c15d0a077e8 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -2806,8 +2806,8 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) | |||
2806 | if (async_dio && iov_iter_rw(iter) != WRITE && offset + count > i_size) { | 2806 | if (async_dio && iov_iter_rw(iter) != WRITE && offset + count > i_size) { |
2807 | if (offset >= i_size) | 2807 | if (offset >= i_size) |
2808 | return 0; | 2808 | return 0; |
2809 | count = min_t(loff_t, count, fuse_round_up(i_size - offset)); | 2809 | iov_iter_truncate(iter, fuse_round_up(i_size - offset)); |
2810 | iov_iter_truncate(iter, count); | 2810 | count = iov_iter_count(iter); |
2811 | } | 2811 | } |
2812 | 2812 | ||
2813 | io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL); | 2813 | io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL); |
@@ -2841,12 +2841,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) | |||
2841 | io->done = &wait; | 2841 | io->done = &wait; |
2842 | 2842 | ||
2843 | if (iov_iter_rw(iter) == WRITE) { | 2843 | if (iov_iter_rw(iter) == WRITE) { |
2844 | ret = generic_write_checks(file, &pos, &count); | 2844 | ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE); |
2845 | if (!ret) { | ||
2846 | iov_iter_truncate(iter, count); | ||
2847 | ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE); | ||
2848 | } | ||
2849 | |||
2850 | fuse_invalidate_attr(inode); | 2845 | fuse_invalidate_attr(inode); |
2851 | } else { | 2846 | } else { |
2852 | ret = __fuse_direct_read(io, iter, &pos); | 2847 | ret = __fuse_direct_read(io, iter, &pos); |