lookup_open(): expand the call of real_lookup()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 28 Apr 2016 15:19:43 +0000 (11:19 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 May 2016 23:51:16 +0000 (19:51 -0400)
... and lose the duplicate IS_DEADDIR() - we'd already checked that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 8d62a89d7bff8fc0b515e8d44095de34fb123785..b9dde8490318606fa5f8804f569fb40a1ec28c0f 100644 (file)
@@ -2969,9 +2969,16 @@ static int lookup_open(struct nameidata *nd, struct path *path,
 
 no_open:
        if (need_lookup) {
-               dentry = lookup_real(dir_inode, dentry, nd->flags);
-               if (IS_ERR(dentry))
-                       return PTR_ERR(dentry);
+               struct dentry *res = dir_inode->i_op->lookup(dir_inode, dentry,
+                                                            nd->flags);
+               if (unlikely(res)) {
+                       if (IS_ERR(res)) {
+                               error = PTR_ERR(res);
+                               goto out_dput;
+                       }
+                       dput(dentry);
+                       dentry = res;
+               }
        }
 
        /* Negative dentry, just create the file */