]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
afs: Fix afs_edit_dir_remove() to get, not find, block 0
authorDavid Howells <dhowells@redhat.com>
Mon, 13 Jul 2026 15:22:55 +0000 (16:22 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 23 Jul 2026 09:32:40 +0000 (11:32 +0200)
Fix afs_edit_dir_remove() to use afs_dir_get_block() to get block 0 rather
than afs_dir_find_block() as the latter caches the found block in the
afs_dir_iter and may[*] switch out the page it's on if another
afs_dir_find_block() is done.  This parallels what afs_edit_dir_add() does.

[*] There's more than one block per page.

Fixes: a5b5beebcf96 ("afs: Use the contained hashtable to search a directory")
Closes: https://sashiko.dev/#/patchset/20260706153408.1231650-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/2380759.1783956175@warthog.procyon.org.uk
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/afs/dir_edit.c

index fd3aa9f97ce64cc033654feffe222b5d65fcfd6e..3ead36a070487a098e2447f79ae7bb7e9dce3439 100644 (file)
@@ -415,7 +415,7 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
        if (!afs_dir_init_iter(&iter, name))
                return;
 
-       meta = afs_dir_find_block(&iter, 0);
+       meta = afs_dir_get_block(&iter, 0);
        if (!meta)
                return;