Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280183
b: refs/heads/master
c: 643822b
h: refs/heads/master
i:
  280181: 142832f
  280179: f8c7937
  280175: 9d470c1
v: v3
  • Loading branch information
Al Viro committed Jan 4, 2012
1 parent bf8fb43 commit ade76dc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 676da58df740f325034b8641311413c2393588e1
refs/heads/master: 643822b41e5e0f133438883b0be574cdaf168a2a
14 changes: 7 additions & 7 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2559,21 +2559,21 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
*
* namespace_sem or vfsmount_lock is held
*/
bool is_path_reachable(struct vfsmount *mnt, struct dentry *dentry,
bool is_path_reachable(struct mount *mnt, struct dentry *dentry,
const struct path *root)
{
while (mnt != root->mnt && mnt_has_parent(real_mount(mnt))) {
dentry = mnt->mnt_mountpoint;
mnt = mnt->mnt_parent;
while (&mnt->mnt != root->mnt && mnt_has_parent(mnt)) {
dentry = mnt->mnt.mnt_mountpoint;
mnt = real_mount(mnt->mnt.mnt_parent);
}
return mnt == root->mnt && is_subdir(dentry, root->dentry);
return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry);
}

int path_is_under(struct path *path1, struct path *path2)
{
int res;
br_read_lock(vfsmount_lock);
res = is_path_reachable(path1->mnt, path1->dentry, path2);
res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2);
br_read_unlock(vfsmount_lock);
return res;
}
Expand Down Expand Up @@ -2659,7 +2659,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
if (!mnt_has_parent(new_mnt))
goto out4; /* not attached */
/* make sure we can reach put_old from new_root */
if (!is_path_reachable(old.mnt, old.dentry, &new))
if (!is_path_reachable(real_mount(old.mnt), old.dentry, &new))
goto out4;
br_write_lock(vfsmount_lock);
detach_mnt(new_mnt, &parent_path);
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/pnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ static struct vfsmount *get_peer_under_root(struct vfsmount *mnt,
struct mnt_namespace *ns,
const struct path *root)
{
struct vfsmount *m = mnt;
struct mount *m = real_mount(mnt);

do {
/* Check the namespace first for optimization */
if (m->mnt_ns == ns && is_path_reachable(m, m->mnt_root, root))
return m;
if (m->mnt.mnt_ns == ns && is_path_reachable(m, m->mnt.mnt_root, root))
return &m->mnt;

m = next_peer(m);
} while (m != mnt);
m = real_mount(next_peer(&m->mnt));
} while (&m->mnt != mnt);

return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/pnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
void release_mounts(struct list_head *);
void umount_tree(struct mount *, int, struct list_head *);
struct mount *copy_tree(struct mount *, struct dentry *, int);
bool is_path_reachable(struct vfsmount *, struct dentry *,
bool is_path_reachable(struct mount *, struct dentry *,
const struct path *root);
#endif /* _LINUX_PNODE_H */

0 comments on commit ade76dc

Please sign in to comment.