mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
__detach_mounts(): use guards
Clean fit for guards use; 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>
This commit is contained in:
@@ -2032,10 +2032,11 @@ void __detach_mounts(struct dentry *dentry)
|
||||
struct pinned_mountpoint mp = {};
|
||||
struct mount *mnt;
|
||||
|
||||
namespace_lock();
|
||||
lock_mount_hash();
|
||||
guard(namespace_excl)();
|
||||
guard(mount_writer)();
|
||||
|
||||
if (!lookup_mountpoint(dentry, &mp))
|
||||
goto out_unlock;
|
||||
return;
|
||||
|
||||
event++;
|
||||
while (mp.node.next) {
|
||||
@@ -2047,9 +2048,6 @@ void __detach_mounts(struct dentry *dentry)
|
||||
else umount_tree(mnt, UMOUNT_CONNECTED);
|
||||
}
|
||||
unpin_mountpoint(&mp);
|
||||
out_unlock:
|
||||
unlock_mount_hash();
|
||||
namespace_unlock();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user