aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namei.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 61995fba4e21..373852012713 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -800,12 +800,8 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p)
800 touch_atime(link->mnt, dentry); 800 touch_atime(link->mnt, dentry);
801 nd_set_link(nd, NULL); 801 nd_set_link(nd, NULL);
802 802
803 if (link->mnt != nd->path.mnt) { 803 if (link->mnt == nd->path.mnt)
804 path_to_nameidata(link, nd); 804 mntget(link->mnt);
805 nd->inode = nd->path.dentry->d_inode;
806 dget(dentry);
807 }
808 mntget(link->mnt);
809 805
810 nd->last_type = LAST_BIND; 806 nd->last_type = LAST_BIND;
811 *p = dentry->d_inode->i_op->follow_link(dentry, nd); 807 *p = dentry->d_inode->i_op->follow_link(dentry, nd);