mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
The buffered read collector zero-fills the tail of a short read that
stops below the inode's i_size (netfs_clear_unread()), so a read that
races an extending write still returns the expected number of bytes.
The non-buffered collector path does no such thing: it just records
how much was transferred.
Add the same zero-fill for the non-buffered case, gated on
NETFS_SREQ_CLEAR_TAIL: a subreq's source sets that flag when a short
result from it is known to be safe to treat as a hole, as opposed to
NETFS_SREQ_HIT_EOF, which means the read genuinely ran off the end of
the file and should be reported short as-is. Only CLEAR_TAIL should
zero-fill here; a real EOF must stay a real short read.
No source currently sets CLEAR_TAIL on an unbuffered/DIO subrequest,
so this is inert on its own -- a following change teaches cifs to set
it in the one case that needs it.
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 | ||
| iterator.c | ||
| Kconfig | ||
| locking.c | ||
| main.c | ||
| Makefile | ||
| misc.c | ||
| objects.c | ||
| read_collect.c | ||
| read_pgpriv2.c | ||
| read_retry.c | ||
| read_single.c | ||
| rolling_buffer.c | ||
| stats.c | ||
| write_collect.c | ||
| write_issue.c | ||
| write_retry.c | ||