Re: [PATCH] fs: use namespace_{lock,unlock} in dissolve_on_fput()
From: Christian Brauner
Date: Fri Apr 11 2025 - 10:10:49 EST
On Thu, Apr 10, 2025 at 05:05:42PM +0200, Jan Stancek wrote:
> In commit b73ec10a4587 ("fs: add fastpath for dissolve_on_fput()"),
> the namespace_{lock,unlock} has been replaced with scoped_guard
> using the namespace_sem. This however now also skips processing of
> 'unmounted' list in namespace_unlock(), and mount is not (immediately)
> cleaned up.
Thank you for spotting and fixing this! My bad.
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 14935a0500a2..ee1fdb3baee0 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -1830,6 +1830,8 @@ static inline void namespace_lock(void)
> down_write(&namespace_sem);
> }
>
> +DEFINE_GUARD(namespace_locked, struct rw_semaphore *, namespace_lock(), namespace_unlock())
I'll call that namespace_lock instead if you don't mind.