diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-30 14:08:28 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-31 16:03:16 -0400 |
commit | 37c17e1f377696c797e75c1e915e838b3e0c6120 (patch) | |
tree | 97af490a11ae06776978b4ed171ba7ceff36128f /fs | |
parent | 3f6c7c71a2af6eb306e16562c6ee1bfdb48015fb (diff) | |
download | linux-3.10-37c17e1f377696c797e75c1e915e838b3e0c6120.tar.gz linux-3.10-37c17e1f377696c797e75c1e915e838b3e0c6120.tar.bz2 linux-3.10-37c17e1f377696c797e75c1e915e838b3e0c6120.zip |
untangling do_lookup() - expand the area under ->i_mutex
keep holding ->i_mutex over revalidation parts
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 157f3debbf9..48fc0fb8c9d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1173,6 +1173,7 @@ retry: BUG_ON(nd->inode != dir); mutex_lock(&dir->i_mutex); +l: dentry = d_lookup(parent, name); if (likely(!dentry)) { dentry = d_alloc_and_lookup(parent, name, nd); @@ -1193,11 +1194,11 @@ retry: need_reval = 0; status = 1; } - mutex_unlock(&dir->i_mutex); if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) status = d_revalidate(dentry, nd); if (unlikely(status <= 0)) { if (status < 0) { + mutex_unlock(&dir->i_mutex); dput(dentry); return status; } @@ -1205,9 +1206,10 @@ retry: dput(dentry); dentry = NULL; need_reval = 1; - goto retry; + goto l; } } + mutex_unlock(&dir->i_mutex); goto done; } if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) |