break;
/* Check mountpoints.. */
__follow_mount(&next);
- if (nd->mnt != next.mnt)
- mntput(nd->mnt);
err = -ENOENT;
inode = next.dentry->d_inode;
goto out_dput;
if (inode->i_op->follow_link) {
+ if (nd->mnt != next.mnt)
+ mntput(nd->mnt);
err = do_follow_link(&next, nd);
if (err)
goto return_err;
break;
} else {
dput(nd->dentry);
+ if (nd->mnt != next.mnt)
+ mntput(nd->mnt);
nd->mnt = next.mnt;
nd->dentry = next.dentry;
}
if (err)
break;
__follow_mount(&next);
- if (nd->mnt != next.mnt)
- mntput(nd->mnt);
inode = next.dentry->d_inode;
if ((lookup_flags & LOOKUP_FOLLOW)
&& inode && inode->i_op && inode->i_op->follow_link) {
+ if (next.mnt != nd->mnt)
+ mntput(nd->mnt);
err = do_follow_link(&next, nd);
if (err)
goto return_err;
inode = nd->dentry->d_inode;
} else {
dput(nd->dentry);
+ if (nd->mnt != next.mnt)
+ mntput(nd->mnt);
nd->mnt = next.mnt;
nd->dentry = next.dentry;
}
return 0;
out_dput:
dput(next.dentry);
+ if (nd->mnt != next.mnt)
+ mntput(nd->mnt);
break;
}
path_release(nd);