diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-08-19 10:12:10 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-08-19 10:12:10 -0700 |
| commit | b19a97d57c15643494ac8bfaaa35e3ee472d41da (patch) | |
| tree | 72cc9ea10b8c8488edd55b9b243ac880df3d746f /fs/pnode.c | |
| parent | 7cca555b94a2191d012837a37c891eca4e876c6b (diff) | |
| parent | fb924b7b8669503582e003dd7b7340ee49029801 (diff) | |
| download | linux-master.tar.gz | |
Pull mount fixes from Al Viro:
"Fixes for several recent mount-related regressions"
* tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
change_mnt_propagation(): calculate propagation source only if we'll need it
use uniform permission checks for all mount propagation changes
propagate_umount(): only surviving overmounts should be reparented
fix the softlockups in attach_recursive_mnt()
Diffstat (limited to 'fs/pnode.c')
| -rw-r--r-- | fs/pnode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index 81f7599bdac4fc..6f7d02f3fa985f 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -111,7 +111,8 @@ void change_mnt_propagation(struct mount *mnt, int type) return; } if (IS_MNT_SHARED(mnt)) { - m = propagation_source(mnt); + if (type == MS_SLAVE || !hlist_empty(&mnt->mnt_slave_list)) + m = propagation_source(mnt); if (list_empty(&mnt->mnt_share)) { mnt_release_group_id(mnt); } else { @@ -637,10 +638,11 @@ void propagate_umount(struct list_head *set) } // now to_umount consists of all acceptable candidates - // deal with reparenting of remaining overmounts on those + // deal with reparenting of surviving overmounts on those list_for_each_entry(m, &to_umount, mnt_list) { - if (m->overmount) - reparent(m->overmount); + struct mount *over = m->overmount; + if (over && !will_be_unmounted(over)) + reparent(over); } // and fold them into the set |
