]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
afs: Fix lack of locking around modifications of net->cells_dyn_ino
authorDavid Howells <dhowells@redhat.com>
Mon, 22 Jun 2026 09:08:52 +0000 (10:08 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 1 Jul 2026 13:26:21 +0000 (15:26 +0200)
commit55e841836c6f4646490f7b0347192b7a92d431ba
tree2595bc7e780151d3d2c7487ba0159dd8646b5bb3
parentfc10c0ecf06f2981af5d04357612b00051e03e9e
afs: Fix lack of locking around modifications of net->cells_dyn_ino

Fix the lack of locking around modifications of net->cells_dyn_ino by
taking net->cells_lock exclusively.  This also requires to cell to be
removed from net->cells_dyn_ino in afs_destroy_cell_work() rather than in
afs_cell_destroy() as the latter runs in RCU cleanup context and sleeping
locks cannot be taken there.

Fixes: 1d0b929fc070 ("afs: Change dynroot to create contents on demand")
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-19-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/cell.c
fs/afs/dynroot.c