mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 09:31:26 +00:00
ca9ca1a5d5
Fix netfs_unbuffered_write_iter() to return immediately if
generic_write_checks() returns 0, indicating there's nothing to write.
Note that netfs_file_write_iter() already does this.
Also, whilst we're at it, put in checks for the size being zero before we
even take the locks. Note that generic_write_checks() can still reduce the
size to zero, so we still need that check.
Without this, a warning similar to the following is logged to dmesg:
netfs: Zero-sized write [R=1b6da]
and the syscall fails with EIO, e.g.:
/sbin/ldconfig.real: Writing of cache extension data failed: Input/output error
This can be reproduced on 9p by:
xfs_io -f -c 'pwrite 0 0' /xfstest.test/foo
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 | ||
output.c | ||
stats.c |