mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
vfs: more mnt_parent cleanups
a) mount --move is checking that ->mnt_parent is non-NULL before looking if that parent happens to be shared; ->mnt_parent is never NULL and it's not even an misspelled !mnt_has_parent() b) pivot_root open-codes is_path_reachable(), poorly. c) so does path_is_under(), while we are at it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b2dba1af3c
commit
afac7cba7e
4 changed files with 29 additions and 55 deletions
15
fs/pnode.c
15
fs/pnode.c
|
@ -28,21 +28,6 @@ static inline struct vfsmount *next_slave(struct vfsmount *p)
|
|||
return list_entry(p->mnt_slave.next, struct vfsmount, mnt_slave);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if path is reachable from root
|
||||
*
|
||||
* namespace_sem is held, and mnt is attached
|
||||
*/
|
||||
static bool is_path_reachable(struct vfsmount *mnt, struct dentry *dentry,
|
||||
const struct path *root)
|
||||
{
|
||||
while (mnt != root->mnt && mnt_has_parent(mnt)) {
|
||||
dentry = mnt->mnt_mountpoint;
|
||||
mnt = mnt->mnt_parent;
|
||||
}
|
||||
return mnt == root->mnt && is_subdir(dentry, root->dentry);
|
||||
}
|
||||
|
||||
static struct vfsmount *get_peer_under_root(struct vfsmount *mnt,
|
||||
struct mnt_namespace *ns,
|
||||
const struct path *root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue