Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234258
b: refs/heads/master
c: 70e9b35
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent c13e055 commit 8aa571c
Show file tree
Hide file tree
Showing 3 changed files with 8 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: 951361f954596bd134d4270df834f47d151f98a6
refs/heads/master: 70e9b3571107b88674cd55ae4bed33f76261e7d3
15 changes: 7 additions & 8 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
return err;
}

static int path_init(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, struct file **fp)
{
int retval = 0;
int fput_needed;
Expand All @@ -1508,7 +1509,6 @@ static int path_init(int dfd, const char *name, unsigned int flags, struct namei
nd->flags = flags | LOOKUP_JUMPED;
nd->depth = 0;
nd->root.mnt = NULL;
nd->file = NULL;

if (*name=='/') {
if (flags & LOOKUP_RCU) {
Expand Down Expand Up @@ -1557,7 +1557,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, struct namei
nd->path = file->f_path;
if (flags & LOOKUP_RCU) {
if (fput_needed)
nd->file = file;
*fp = file;
nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
br_read_lock(vfsmount_lock);
rcu_read_lock();
Expand All @@ -1580,6 +1580,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, struct namei
static int path_lookupat(int dfd, const char *name,
unsigned int flags, struct nameidata *nd)
{
struct file *base = NULL;
int retval;

/*
Expand All @@ -1596,7 +1597,7 @@ static int path_lookupat(int dfd, const char *name,
* be handled by restarting a traditional ref-walk (which will always
* be able to complete).
*/
retval = path_init(dfd, name, flags, nd);
retval = path_init(dfd, name, flags, nd, &base);

if (unlikely(retval))
return retval;
Expand All @@ -1614,10 +1615,8 @@ static int path_lookupat(int dfd, const char *name,
if (!retval)
retval = handle_reval_path(nd);

if (nd->file) {
fput(nd->file);
nd->file = NULL;
}
if (base)
fput(base);

if (nd->root.mnt) {
path_put(&nd->root);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/namei.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct nameidata {
struct path path;
struct qstr last;
struct path root;
struct file *file;
struct inode *inode; /* path.dentry.d_inode */
unsigned int flags;
unsigned seq;
Expand Down

0 comments on commit 8aa571c

Please sign in to comment.