Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1840
b: refs/heads/master
c: 90ebe56
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jun 6, 2005
1 parent 4655176 commit 9d00504
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: 4481e8eea761857367162b0957277d5524fbea63
refs/heads/master: 90ebe5654febe3555a2516d51d3d251226d35fdb
20 changes: 10 additions & 10 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ static inline int __vfs_follow_link(struct nameidata *nd, const char *link)
return PTR_ERR(link);
}

struct path {
struct vfsmount *mnt;
struct dentry *dentry;
};

static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int error;
Expand All @@ -518,7 +523,7 @@ static inline int __do_follow_link(struct dentry *dentry, struct nameidata *nd)
* Without that kind of total limit, nasty chains of consecutive
* symlinks can cause almost arbitrarily long lookups.
*/
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 err = -ELOOP;
if (current->link_count >= MAX_NESTED_LINKS)
Expand All @@ -527,13 +532,13 @@ static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
goto loop;
BUG_ON(nd->depth >= MAX_NESTED_LINKS);
cond_resched();
err = security_inode_follow_link(dentry, nd);
err = security_inode_follow_link(path->dentry, nd);
if (err)
goto loop;
current->link_count++;
current->total_link_count++;
nd->depth++;
err = __do_follow_link(dentry, nd);
err = __do_follow_link(path->dentry, nd);
current->link_count--;
nd->depth--;
return err;
Expand Down Expand Up @@ -641,11 +646,6 @@ static inline void follow_dotdot(struct vfsmount **mnt, struct dentry **dentry)
follow_mount(mnt, dentry);
}

struct path {
struct vfsmount *mnt;
struct dentry *dentry;
};

/*
* It's more convoluted than I'd like it to be, but... it's still fairly
* small and for now I'd prefer to have fast path as straight as possible.
Expand Down Expand Up @@ -784,7 +784,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)

if (inode->i_op->follow_link) {
mntget(next.mnt);
err = do_follow_link(next.dentry, nd);
err = do_follow_link(&next, nd);
dput(next.dentry);
mntput(next.mnt);
if (err)
Expand Down Expand Up @@ -838,7 +838,7 @@ static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
if ((lookup_flags & LOOKUP_FOLLOW)
&& inode && inode->i_op && inode->i_op->follow_link) {
mntget(next.mnt);
err = do_follow_link(next.dentry, nd);
err = do_follow_link(&next, nd);
dput(next.dentry);
mntput(next.mnt);
if (err)
Expand Down

0 comments on commit 9d00504

Please sign in to comment.