mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
mnt: In detach_mounts detach the appropriate unmounted mount
commitfe78fcc85aupstream. The handling of in detach_mounts of unmounted but connected mounts is buggy and can lead to an infinite loop. Correct the handling of unmounted mounts in detach_mount. When the mountpoint of an unmounted but connected mount is connected to a dentry, and that dentry is deleted we need to disconnect that mount from the parent mount and the deleted dentry. Nothing changes for the unmounted and connected children. They can be safely ignored. Fixes:ce07d891a0mnt: Honor MNT_LOCKED when detaching mounts Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4647b34f1a
commit
3af9ac3e22
@@ -1554,11 +1554,8 @@ void __detach_mounts(struct dentry *dentry)
|
||||
while (!hlist_empty(&mp->m_list)) {
|
||||
mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list);
|
||||
if (mnt->mnt.mnt_flags & MNT_UMOUNT) {
|
||||
struct mount *p, *tmp;
|
||||
list_for_each_entry_safe(p, tmp, &mnt->mnt_mounts, mnt_child) {
|
||||
hlist_add_head(&p->mnt_umount.s_list, &unmounted);
|
||||
umount_mnt(p);
|
||||
}
|
||||
hlist_add_head(&mnt->mnt_umount.s_list, &unmounted);
|
||||
umount_mnt(mnt);
|
||||
}
|
||||
else umount_tree(mnt, UMOUNT_CONNECTED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user