]> www.infradead.org Git - nvme.git/commit
fs: actually hold the namespace semaphore
authorChristian Brauner <brauner@kernel.org>
Thu, 3 Apr 2025 14:43:50 +0000 (16:43 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2025 22:45:35 +0000 (15:45 -0700)
commitc0dbd11ada2c94edc337a5f6665cbaa6079ff785
treec2954c5be7d13497f195ccd43125292560b1d190
parent56770e24f678a84a21f21bcc1ae9cbc1364677bd
fs: actually hold the namespace semaphore

Don't use a scoped guard that only protects the next statement.

Use a regular guard to make sure that the namespace semaphore is held
across the whole function.

Signed-off-by: Christian Brauner <brauner@kernel.org>
Reported-by: Leon Romanovsky <leon@kernel.org>
Link: https://lore.kernel.org/all/20250401170715.GA112019@unreal/
Fixes: db04662e2f4f ("fs: allow detached mounts in clone_private_mount()")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namespace.c