Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147810
b: refs/heads/master
c: 9b4a9b1
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jun 12, 2009
1 parent ea5f2d1 commit 6913ad1
Show file tree
Hide file tree
Showing 2 changed files with 22 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: 4e44b6852e03c915618ca6776b6697b436246b00
refs/heads/master: 9b4a9b14a793bc69b505ed916051f6f32db13bb8
31 changes: 21 additions & 10 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,7 @@ static int path_walk(const char *name, struct nameidata *nd)
return link_path_walk(name, nd);
}

/* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
static int do_path_lookup(int dfd, const char *name,
unsigned int flags, struct nameidata *nd)
static int path_init(int dfd, const char *name, unsigned int flags, struct nameidata *nd)
{
int retval = 0;
int fput_needed;
Expand Down Expand Up @@ -1063,17 +1061,25 @@ static int do_path_lookup(int dfd, const char *name,

fput_light(file, fput_needed);
}
return 0;

retval = path_walk(name, nd);
fput_fail:
fput_light(file, fput_needed);
out_fail:
return retval;
}

/* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
static int do_path_lookup(int dfd, const char *name,
unsigned int flags, struct nameidata *nd)
{
int retval = path_init(dfd, name, flags, nd);
if (!retval)
retval = path_walk(name, nd);
if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry &&
nd->path.dentry->d_inode))
audit_inode(name, nd->path.dentry);
out_fail:
return retval;

fput_fail:
fput_light(file, fput_needed);
goto out_fail;
}

int path_lookup(const char *name, unsigned int flags,
Expand Down Expand Up @@ -1676,9 +1682,14 @@ struct file *do_filp_open(int dfd, const char *pathname,
/*
* Create - we need to know the parent.
*/
error = do_path_lookup(dfd, pathname, LOOKUP_PARENT, &nd);
error = path_init(dfd, pathname, LOOKUP_PARENT, &nd);
if (error)
return ERR_PTR(error);
error = path_walk(pathname, &nd);
if (error)
return ERR_PTR(error);
if (unlikely(!audit_dummy_context()))
audit_inode(pathname, nd.path.dentry);

/*
* We have the parent and last component. First of all, check
Expand Down

0 comments on commit 6913ad1

Please sign in to comment.