Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1850
b: refs/heads/master
c: 2f12dbf
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jun 6, 2005
1 parent 3261495 commit b276866
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 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: e13b210f6f7bdc44dfee0a9bbd633a32db0d6333
refs/heads/master: 2f12dbfbb6286c725c283a169f8f05e89a86848b
14 changes: 10 additions & 4 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,6 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
break;
/* Check mountpoints.. */
__follow_mount(&next);
if (nd->mnt != next.mnt)
mntput(nd->mnt);

err = -ENOENT;
inode = next.dentry->d_inode;
Expand All @@ -803,6 +801,8 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
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;
Expand All @@ -815,6 +815,8 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
break;
} else {
dput(nd->dentry);
if (nd->mnt != next.mnt)
mntput(nd->mnt);
nd->mnt = next.mnt;
nd->dentry = next.dentry;
}
Expand Down Expand Up @@ -851,17 +853,19 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
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;
}
Expand Down Expand Up @@ -901,6 +905,8 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
return 0;
out_dput:
dput(next.dentry);
if (nd->mnt != next.mnt)
mntput(nd->mnt);
break;
}
path_release(nd);
Expand Down

0 comments on commit b276866

Please sign in to comment.