mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
put_mnt_ns(): use guards
clean fit; guards can't be weaker due to umount_tree() call. Setting emptied_ns requires namespace_excl, but not anything mount_lock-related. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -6153,12 +6153,10 @@ void put_mnt_ns(struct mnt_namespace *ns)
|
||||
{
|
||||
if (!refcount_dec_and_test(&ns->ns.count))
|
||||
return;
|
||||
namespace_lock();
|
||||
guard(namespace_excl)();
|
||||
emptied_ns = ns;
|
||||
lock_mount_hash();
|
||||
guard(mount_writer)();
|
||||
umount_tree(ns->root, 0);
|
||||
unlock_mount_hash();
|
||||
namespace_unlock();
|
||||
}
|
||||
|
||||
struct vfsmount *kern_mount(struct file_system_type *type)
|
||||
|
||||
Reference in New Issue
Block a user