Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234246
b: refs/heads/master
c: 086e183
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent 0c78045 commit a98a946
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 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: 16c2cd7179881d5dd87779512ca5a0d657c64f62
refs/heads/master: 086e183a641109033420e0b26ddecb6f4abb4c89
30 changes: 12 additions & 18 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,6 @@ static int nameidata_drop_rcu_last(struct nameidata *nd)
return -ECHILD;
}

/* Try to drop out of rcu-walk mode if we were in it, otherwise do nothing. */
static inline int nameidata_drop_rcu_last_maybe(struct nameidata *nd)
{
if (likely(nd->flags & LOOKUP_RCU))
return nameidata_drop_rcu_last(nd);
return 0;
}

/**
* release_open_intent - free up open intent resources
* @nd: pointer to nameidata
Expand Down Expand Up @@ -1339,7 +1331,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
while (*name=='/')
name++;
if (!*name)
goto return_base;
return 0;

if (nd->depth)
lookup_flags = LOOKUP_FOLLOW | (nd->flags & LOOKUP_CONTINUE);
Expand Down Expand Up @@ -1448,7 +1440,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
} else
follow_dotdot(nd);
}
goto return_base;
return 0;
}
err = do_lookup(nd, &this, &next, &inode);
if (err)
Expand All @@ -1471,13 +1463,10 @@ static int link_path_walk(const char *name, struct nameidata *nd)
if (!nd->inode->i_op->lookup)
break;
}
goto return_base;
return 0;
lookup_parent:
nd->last = this;
nd->last_type = type;
return_base:
if (nameidata_drop_rcu_last_maybe(nd))
return -ECHILD;
return 0;
out_dput:
if (!(nd->flags & LOOKUP_RCU))
Expand Down Expand Up @@ -1598,10 +1587,15 @@ static int path_lookupat(int dfd, const char *name,

if (nd->flags & LOOKUP_RCU) {
/* RCU dangling. Cancel it. */
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
if (!retval) {
if (nameidata_drop_rcu_last(nd))
retval = -ECHILD;
} else {
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
}
}

if (!retval)
Expand Down

0 comments on commit a98a946

Please sign in to comment.