]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
afs: Fix the volume AFS_VOLUME_RM_TREE is set on
authorDavid Howells <dhowells@redhat.com>
Mon, 22 Jun 2026 09:08:54 +0000 (10:08 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:22 +0000 (15:26 +0200)
commit56b4e4b26f84411d880f968a539207b0a8889c8c
tree97df7bde10d1eaedaf6ca7f6af783fa364954468
parent26f17ce6fa3f05cb5965790499c1839094260de4
afs: Fix the volume AFS_VOLUME_RM_TREE is set on

Fix afs_insert_volume_into_cell() to set AFS_VOLUME_RM_TREE on the volume
replaced, not the new volume, as it's now removed from the cell's volume
tree.  This will cause the old volume to be removed from the tree twice and
the new volume never to be removed.

Fixes: 9a6b294ab496 ("afs: Fix use-after-free due to get/remove race in volume tree")
Closes: https://sashiko.dev/#/patchset/20260618074903.2374756-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260622090856.2746629-21-dhowells@redhat.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/afs/volume.c