untangling do_lookup() - merge d_alloc_and_lookup() callers
Al Viro [Fri, 30 Mar 2012 18:39:15 +0000 (14:39 -0400)]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

fs/namei.c

index a0f9a02..1d60fdf 100644 (file)
@@ -1188,12 +1188,12 @@ retry:
                                }
                                if (!d_invalidate(dentry)) {
                                        dput(dentry);
-                                       dentry = d_alloc_and_lookup(parent, name, nd);
+                                       dentry = NULL;
                                }
                        }
-               } else if (!dentry) {
-                       dentry = d_alloc_and_lookup(parent, name, nd);
                }
+               if (!dentry)
+                       dentry = d_alloc_and_lookup(parent, name, nd);
        l:
                mutex_unlock(&dir->i_mutex);
                if (IS_ERR(dentry))