child->mnt_mountpoint);
commit_tree(child);
if (q) {
+ struct mount *r = topmost_overmount(child);
struct mountpoint *mp = root.mp;
- struct mount *r = child;
- while (unlikely(r->overmount))
- r = r->overmount;
+
if (unlikely(shorter) && child != source_mnt)
mp = shorter;
mnt_change_mountpoint(r, mp, q);
guard(mount_locked_reader)();
- root = current->nsproxy->mnt_ns->root;
- while (unlikely(root->overmount))
- root = root->overmount;
+ root = topmost_overmount(current->nsproxy->mnt_ns->root);
return fs_root.mnt != &root->mnt || !path_mounted(&fs_root);
}