Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257324
b: refs/heads/master
c: d2d9e9f
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 20, 2011
1 parent 1448395 commit 178646f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 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: 4ad5abb3d01a2c10854969b00982fadb130784a6
refs/heads/master: d2d9e9fbc2f8f492dae373482da61d34475c53c1
42 changes: 18 additions & 24 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,28 +436,6 @@ static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
return dentry->d_op->d_revalidate(dentry, nd);
}

static struct dentry *
do_revalidate(struct dentry *dentry, struct nameidata *nd)
{
int status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
/*
* The dentry failed validation.
* If d_revalidate returned 0 attempt to invalidate
* the dentry otherwise d_revalidate is asking us
* to return a fail status.
*/
if (status < 0) {
dput(dentry);
dentry = ERR_PTR(status);
} else if (!d_invalidate(dentry)) {
dput(dentry);
dentry = NULL;
}
}
return dentry;
}

/**
* complete_walk - successful completion of path walk
* @nd: pointer nameidata
Expand Down Expand Up @@ -1642,8 +1620,24 @@ static struct dentry *__lookup_hash(struct qstr *name,
return dentry;
}

if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE))
dentry = do_revalidate(dentry, nd);
if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) {
int status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
/*
* The dentry failed validation.
* If d_revalidate returned 0 attempt to invalidate
* the dentry otherwise d_revalidate is asking us
* to return a fail status.
*/
if (status < 0) {
dput(dentry);
return ERR_PTR(status);
} else if (!d_invalidate(dentry)) {
dput(dentry);
dentry = NULL;
}
}
}

if (!dentry)
dentry = d_alloc_and_lookup(base, name, nd);
Expand Down

0 comments on commit 178646f

Please sign in to comment.