]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfs, afs: Fix write skipping in dir/link writepages
authorDavid Howells <dhowells@redhat.com>
Tue, 12 May 2026 12:34:00 +0000 (13:34 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 12 May 2026 12:42:32 +0000 (14:42 +0200)
commit9871938f99cc6cb266a77265491660e2375271f5
tree1edd8ee1aa299d43a401a0c2b8552551d21053a7
parentded0c6f1606061148c202825f7e53d711f9f84cf
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: 6dd80936618c ("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>
fs/afs/dir.c
fs/netfs/write_issue.c