Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233240
b: refs/heads/master
c: f60aef7
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Feb 15, 2011
1 parent 6967e0d commit bd8ebe6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 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: f5e1c1c1afc1d979e2ac6a24cc99ba7143639f4d
refs/heads/master: f60aef7ec625236a6366722bb1be7b37596bf0ae
25 changes: 6 additions & 19 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,25 +571,9 @@ void release_open_intent(struct nameidata *nd)
}
}

/*
* Call d_revalidate and handle filesystems that request rcu-walk
* to be dropped. This may be called and return in rcu-walk mode,
* regardless of success or error. If -ECHILD is returned, the caller
* must return -ECHILD back up the path walk stack so path walk may
* be restarted in ref-walk mode.
*/
static int d_revalidate(struct dentry *dentry, struct nameidata *nd)
static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
{
int status;

status = dentry->d_op->d_revalidate(dentry, nd);
if (status == -ECHILD) {
if (nameidata_dentry_drop_rcu(nd, dentry))
return status;
status = dentry->d_op->d_revalidate(dentry, nd);
}

return status;
return dentry->d_op->d_revalidate(dentry, nd);
}

static struct dentry *
Expand Down Expand Up @@ -617,7 +601,7 @@ do_revalidate(struct dentry *dentry, struct nameidata *nd)
static inline struct dentry *
do_revalidate_rcu(struct dentry *dentry, struct nameidata *nd)
{
int status = dentry->d_op->d_revalidate(dentry, nd);
int status = d_revalidate(dentry, nd);
if (likely(status > 0))
return dentry;
if (status == -ECHILD) {
Expand Down Expand Up @@ -1517,12 +1501,15 @@ static int link_path_walk(const char *name, struct nameidata *nd)
* We may need to check the cached dentry for staleness.
*/
if (need_reval_dot(nd->path.dentry)) {
if (nameidata_drop_rcu_last_maybe(nd))
return -ECHILD;
/* Note: we do not d_invalidate() */
err = d_revalidate(nd->path.dentry, nd);
if (!err)
err = -ESTALE;
if (err < 0)
break;
return 0;
}
return_base:
if (nameidata_drop_rcu_last_maybe(nd))
Expand Down

0 comments on commit bd8ebe6

Please sign in to comment.