kernel-ark/fs/fuse
Maxim Patlasov e5c5f05dca fuse: fix alignment in short read optimization for async_dio
The bug was introduced with async_dio feature: trying to optimize short reads,
we cut number-of-bytes-to-read to i_size boundary. Hence the following example:

	truncate --size=300 /mnt/file
	dd if=/mnt/file of=/dev/null iflag=direct

led to FUSE_READ request of 300 bytes size. This turned out to be problem
for userspace fuse implementations who rely on assumption that kernel fuse
does not change alignment of request from client FS.

The patch turns off the optimization if async_dio is disabled. And, if it's
enabled, the patch fixes adjustment of number-of-bytes-to-read to preserve
alignment.

Note, that we cannot throw out short read optimization entirely because
otherwise a direct read of a huge size issued on a tiny file would generate
a huge amount of fuse requests and most of them would be ACKed by userspace
with zero bytes read.

Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
2013-06-03 15:15:42 +02:00
..
control.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
cuse.c Merge branch 'akpm' (incoming from Andrew) 2013-05-07 20:49:51 -07:00
dev.c Merge branch 'akpm' (incoming from Andrew) 2013-05-07 20:49:51 -07:00
dir.c fuse: fix readdirplus Oops in fuse_dentry_revalidate 2013-06-03 14:40:22 +02:00
file.c fuse: fix alignment in short read optimization for async_dio 2013-06-03 15:15:42 +02:00
fuse_i.h fuse: add flag to turn on async direct IO 2013-05-01 14:37:21 +02:00
inode.c fuse: fix readdirplus Oops in fuse_dentry_revalidate 2013-06-03 14:40:22 +02:00
Kconfig fuse: Move CUSE Kconfig entry from fs/Kconfig into fs/fuse/Kconfig 2013-01-17 13:08:45 +01:00
Makefile