diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-30 20:37:42 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-31 22:03:16 +0200 |
commit | ec335e91a4f088d8759c1311d0724e609d1c318e (patch) | |
tree | 43163e92febda81023fcee742a9667f34ef39063 /fs/namei.c | |
parent | untangling do_lookup() - massage !dentry case towards __lookup_hash() (diff) | |
download | linux-ec335e91a4f088d8759c1311d0724e609d1c318e.tar.xz linux-ec335e91a4f088d8759c1311d0724e609d1c318e.zip |
untangling do_lookup() - merge failure exits in !dentry case
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r-- | fs/namei.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/namei.c b/fs/namei.c index 5414438abff0..a0f9a0294ff2 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1176,35 +1176,28 @@ retry: dentry = d_lookup(parent, name); if (dentry && d_need_lookup(dentry)) { dentry = d_inode_lookup(parent, dentry, nd); - if (IS_ERR(dentry)) { - mutex_unlock(&dir->i_mutex); - return PTR_ERR(dentry); - } - } else if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) { + goto l; + } + if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) { status = d_revalidate(dentry, nd); if (unlikely(status <= 0)) { if (status < 0) { - mutex_unlock(&dir->i_mutex); dput(dentry); - return status; + dentry = ERR_PTR(status); + goto l; } if (!d_invalidate(dentry)) { dput(dentry); dentry = d_alloc_and_lookup(parent, name, nd); - if (IS_ERR(dentry)) { - mutex_unlock(&dir->i_mutex); - return PTR_ERR(dentry); - } } } } else if (!dentry) { dentry = d_alloc_and_lookup(parent, name, nd); - if (IS_ERR(dentry)) { - mutex_unlock(&dir->i_mutex); - return PTR_ERR(dentry); - } } + l: mutex_unlock(&dir->i_mutex); + if (IS_ERR(dentry)) + return PTR_ERR(dentry); goto done; } if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) |