Skip to content

Commit

Permalink
d_path: prepend_path(): get rid of vfsmnt
Browse files Browse the repository at this point in the history
it's kept equal to &mnt->mnt all along.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 19, 2021
1 parent ad08ae5 commit 7c0d552
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions fs/d_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ static int prepend_path(const struct path *path,
struct prepend_buffer *p)
{
struct dentry *dentry;
struct vfsmount *vfsmnt;
struct mount *mnt;
int error = 0;
unsigned seq, m_seq = 0;
Expand All @@ -105,18 +104,17 @@ static int prepend_path(const struct path *path,
b = *p;
error = 0;
dentry = path->dentry;
vfsmnt = path->mnt;
mnt = real_mount(vfsmnt);
mnt = real_mount(path->mnt);
read_seqbegin_or_lock(&rename_lock, &seq);
while (dentry != root->dentry || vfsmnt != root->mnt) {
while (dentry != root->dentry || &mnt->mnt != root->mnt) {
struct dentry * parent;

if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
if (dentry == mnt->mnt.mnt_root || IS_ROOT(dentry)) {
struct mount *parent = READ_ONCE(mnt->mnt_parent);
struct mnt_namespace *mnt_ns;

/* Escaped? */
if (dentry != vfsmnt->mnt_root) {
if (dentry != mnt->mnt.mnt_root) {
b = *p;
error = 3;
break;
Expand All @@ -125,7 +123,6 @@ static int prepend_path(const struct path *path,
if (mnt != parent) {
dentry = READ_ONCE(mnt->mnt_mountpoint);
mnt = parent;
vfsmnt = &mnt->mnt;
continue;
}
mnt_ns = READ_ONCE(mnt->mnt_ns);
Expand Down

0 comments on commit 7c0d552

Please sign in to comment.