mirror-linux/fs/netfs
David Howells 9871938f99
netfs, afs: Fix write skipping in dir/link writepages
Fix netfs_write_single() and afs_single_writepages() to better handle a
write that would be skipped due to lock contention and WB_SYNC_NONE by
returning 1 from netfs_write_single() if it skipped and making
afs_single_writepages() skip also.  If a skip occurs, the inode must be
re-marked as the VFS may have cleared the mark.

This is really only theoretical for directories in netfs_write_single() as
the only path to that is through afs_single_writepages() that takes the
->validate_lock around it, thereby serialising it.

Fixes: 6dd8093661 ("afs: Use netfslib for directories")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260512123404.719402-24-dhowells@redhat.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
2026-05-12 14:42:32 +02:00
..
Kconfig netfs: clean up after renaming FSCACHE_DEBUG config 2024-08-12 22:03:26 +02:00
Makefile netfs: Add support for caching single monolithic objects such as AFS dirs 2024-12-20 22:34:06 +01:00
buffered_read.c netfs: Fix netfs_read_folio() to wait on writeback 2026-05-12 14:42:32 +02:00
buffered_write.c netfs: Fix folio->private handling in netfs_perform_write() 2026-05-12 14:42:32 +02:00
direct_read.c netfs: Fix cancellation of a DIO and single read subrequests 2026-05-12 14:42:29 +02:00
direct_write.c netfs: Fix potential for tearing in ->remote_i_size and ->zero_point 2026-05-12 14:42:30 +02:00
fscache_cache.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fscache_cookie.c netfs: Mark __nonstring lookup tables 2025-04-17 10:13:46 +02:00
fscache_internal.h netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
fscache_io.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
fscache_main.c fscache: delete fscache_cookie_lru_timer when fscache exits to avoid UAF 2024-09-01 10:30:25 +02:00
fscache_proc.c netfs: Fix proc/fs/fscache symlink to point to "netfs" not "../netfs" 2024-01-04 13:15:32 +00:00
fscache_stats.c netfs: Fix interaction between write-streaming and cachefiles culling 2024-01-05 15:42:25 +00:00
fscache_volume.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
internal.h netfs: Fix cancellation of a DIO and single read subrequests 2026-05-12 14:42:29 +02:00
iterator.c netfs: Fix overrun check in netfs_extract_user_iter() 2026-05-12 14:42:30 +02:00
locking.c netfs: Downgrade i_rwsem for a buffered write 2024-10-17 15:33:42 +02:00
main.c netfs: Renumber the NETFS_RREQ_* flags to make traces easier to read 2025-07-01 22:37:14 +02:00
misc.c netfs: Fix partial invalidation of streaming-write folio 2026-05-12 14:42:32 +02:00
objects.c vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
read_collect.c netfs: Fix potential UAF in netfs_unlock_abandoned_read_pages() 2026-05-12 14:42:32 +02:00
read_pgpriv2.c netfs: fix reference leak 2025-09-26 10:14:19 +02:00
read_retry.c netfs: Fix potential UAF in netfs_unlock_abandoned_read_pages() 2026-05-12 14:42:32 +02:00
read_single.c netfs: Fix cancellation of a DIO and single read subrequests 2026-05-12 14:42:29 +02:00
rolling_buffer.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
stats.c netfs: Add retry stat counters 2025-02-13 16:00:48 +01:00
write_collect.c netfs: Fix potential for tearing in ->remote_i_size and ->zero_point 2026-05-12 14:42:30 +02:00
write_issue.c netfs, afs: Fix write skipping in dir/link writepages 2026-05-12 14:42:32 +02:00
write_retry.c netfs: Fix missing locking around retry adding new subreqs 2026-05-12 14:42:29 +02:00