Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1846
b: refs/heads/master
c: cd4e91d
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jun 6, 2005
1 parent 2802f70 commit 54c7998
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 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: 839d9f93c9f1623fb37234d464d739617879d97e
refs/heads/master: cd4e91d3bca8d5527289f5984cf32e9fe6fb8293
17 changes: 8 additions & 9 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,15 @@ struct path {
struct dentry *dentry;
};

static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
static inline int __do_follow_link(struct path *path, struct nameidata *nd)
{
int error;
struct dentry *dentry = path->dentry;

touch_atime(nd->mnt, dentry);
nd_set_link(nd, NULL);

mntget(path->mnt);
error = dentry->d_inode->i_op->follow_link(dentry, nd);
if (!error) {
char *s = nd_get_link(nd);
Expand All @@ -512,6 +515,8 @@ static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, nd);
}
dput(dentry);
mntput(path->mnt);

return error;
}
Expand All @@ -538,10 +543,7 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
current->link_count++;
current->total_link_count++;
nd->depth++;
mntget(path->mnt);
err = __do_follow_link(path->dentry, nd);
dput(path->dentry);
mntput(path->mnt);
err = __do_follow_link(path, nd);
current->link_count--;
nd->depth--;
return err;
Expand Down Expand Up @@ -1523,10 +1525,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
error = security_inode_follow_link(path.dentry, nd);
if (error)
goto exit_dput;
mntget(path.mnt);
error = __do_follow_link(path.dentry, nd);
dput(path.dentry);
mntput(path.mnt);
error = __do_follow_link(&path, nd);
path.mnt = nd->mnt;
if (error)
return error;
Expand Down

0 comments on commit 54c7998

Please sign in to comment.