open_last_lookups(): don't abuse complete_walk() when all we want is unlazy
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 10 Mar 2020 14:09:26 +0000 (10:09 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Apr 2020 05:09:29 +0000 (01:09 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 6cb41608c47c97fa1d2b2d303e079f9523df0846..9f2d95aa2502db563b4f734ea4b87f7f8ae35994 100644 (file)
@@ -3147,15 +3147,11 @@ static const char *open_last_lookups(struct nameidata *nd,
                BUG_ON(nd->flags & LOOKUP_RCU);
        } else {
                /* create side of things */
-               /*
-                * This will *only* deal with leaving RCU mode - LOOKUP_JUMPED
-                * has been cleared when we got to the last component we are
-                * about to look up
-                */
-               error = complete_walk(nd);
-               if (unlikely(error))
-                       return ERR_PTR(error);
-
+               if (nd->flags & LOOKUP_RCU) {
+                       error = unlazy_walk(nd);
+                       if (unlikely(error))
+                               return ERR_PTR(error);
+               }
                audit_inode(nd->name, dir, AUDIT_INODE_PARENT);
                /* trailing slashes? */
                if (unlikely(nd->last.name[nd->last.len]))