]> www.infradead.org Git - users/hch/misc.git/commitdiff
mark_mounts_for_expiry(): use guards
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Aug 2025 00:20:44 +0000 (20:20 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 2 Sep 2025 23:35:56 +0000 (19:35 -0400)
Clean fit; guards can't be weaker due to umount_tree() calls.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index 13e2f3837a269547a58990230ace94eaecbd8cfb..898a6b7307e42b983987a6b837e25e6aba1f9e09 100644 (file)
@@ -3886,8 +3886,8 @@ void mark_mounts_for_expiry(struct list_head *mounts)
        if (list_empty(mounts))
                return;
 
-       namespace_lock();
-       lock_mount_hash();
+       guard(namespace_excl)();
+       guard(mount_writer)();
 
        /* extract from the expiration list every vfsmount that matches the
         * following criteria:
@@ -3909,8 +3909,6 @@ void mark_mounts_for_expiry(struct list_head *mounts)
                touch_mnt_namespace(mnt->mnt_ns);
                umount_tree(mnt, UMOUNT_PROPAGATE|UMOUNT_SYNC);
        }
-       unlock_mount_hash();
-       namespace_unlock();
 }
 
 EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);