diff options
author | Maxim Patlasov <mpatlasov@parallels.com> | 2013-05-30 12:41:34 (GMT) |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-06-03 13:15:42 (GMT) |
commit | e5c5f05dca0cf90f0f3bb1aea85dcf658baff185 (patch) | |
tree | d6290697847d61da2c4a183d9ea521989a814a43 /block/partition-generic.c | |
parent | c9ecf989cc7626e9edf8abef79f64b909542129b (diff) | |
download | linux-e5c5f05dca0cf90f0f3bb1aea85dcf658baff185.tar.xz |
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>
Diffstat (limited to 'block/partition-generic.c')
0 files changed, 0 insertions, 0 deletions