mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
1da29f2c39
Short DIO reads, particularly in relation to cifs, are not being handled
correctly by cifs and netfslib. This can be tested by doing a DIO read of
a file where the size of read is larger than the size of the file. When it
crosses the EOF, it gets a short read and this gets retried, and in the
case of cifs, the retry read fails, with the failure being translated to
ENODATA.
Fix this by the following means:
(1) Add a flag, NETFS_SREQ_HIT_EOF, for the filesystem to set when it
detects that the read did hit the EOF.
(2) Make the netfslib read assessment stop processing subrequests when it
encounters one with that flag set.
(3) Return rreq->transferred, the accumulated contiguous amount read to
that point, to userspace for a DIO read.
(4) Make cifs set the flag and clear the error if the read RPC returned
ENODATA.
(5) Make cifs set the flag and clear the error if a short read occurred
without error and the read-to file position is now at the remote inode
size.
Fixes:
|
||
---|---|---|
.. | ||
buffered_read.c | ||
buffered_write.c | ||
direct_read.c | ||
direct_write.c | ||
fscache_cache.c | ||
fscache_cookie.c | ||
fscache_internal.h | ||
fscache_io.c | ||
fscache_main.c | ||
fscache_proc.c | ||
fscache_stats.c | ||
fscache_volume.c | ||
internal.h | ||
io.c | ||
iterator.c | ||
Kconfig | ||
locking.c | ||
main.c | ||
Makefile | ||
misc.c | ||
objects.c | ||
stats.c | ||
write_collect.c | ||
write_issue.c |