*/
 
 /**
- * unlazy_walk - try to switch to ref-walk mode.
+ * try_to_unlazy - try to switch to ref-walk mode.
  * @nd: nameidata pathwalk data
- * Returns: 0 on success, -ECHILD on failure
+ * Returns: true on success, false on failure
  *
- * unlazy_walk attempts to legitimize the current nd->path and nd->root
+ * try_to_unlazy attempts to legitimize the current nd->path and nd->root
  * for ref-walk mode.
  * Must be called from rcu-walk context.
- * Nothing should touch nameidata between unlazy_walk() failure and
+ * Nothing should touch nameidata between try_to_unlazy() failure and
  * terminate_walk().
  */
-static int unlazy_walk(struct nameidata *nd)
+static bool try_to_unlazy(struct nameidata *nd)
 {
        struct dentry *parent = nd->path.dentry;
 
                goto out;
        rcu_read_unlock();
        BUG_ON(nd->inode != parent->d_inode);
-       return 0;
+       return true;
 
 out1:
        nd->path.mnt = NULL;
        nd->path.dentry = NULL;
 out:
        rcu_read_unlock();
-       return -ECHILD;
+       return false;
 }
 
 /**
                 */
                if (!(nd->flags & (LOOKUP_ROOT | LOOKUP_IS_SCOPED)))
                        nd->root.mnt = NULL;
-               if (unlikely(unlazy_walk(nd)))
+               if (!try_to_unlazy(nd))
                        return -ECHILD;
        }
 
                unsigned seq;
                dentry = __d_lookup_rcu(parent, &nd->last, &seq);
                if (unlikely(!dentry)) {
-                       if (unlazy_walk(nd))
+                       if (!try_to_unlazy(nd))
                                return ERR_PTR(-ECHILD);
                        return NULL;
                }
 {
        if (nd->flags & LOOKUP_RCU) {
                int err = inode_permission(nd->inode, MAY_EXEC|MAY_NOT_BLOCK);
-               if (err != -ECHILD)
+               if (err != -ECHILD || !try_to_unlazy(nd))
                        return err;
-               if (unlazy_walk(nd))
-                       return -ECHILD;
        }
        return inode_permission(nd->inode, MAY_EXEC);
 }
                // unlazy even if we fail to grab the link - cleanup needs it
                bool grabbed_link = legitimize_path(nd, link, seq);
 
-               if (unlazy_walk(nd) != 0 || !grabbed_link)
+               if (!try_to_unlazy(nd) != 0 || !grabbed_link)
                        return -ECHILD;
 
                if (nd_alloc_stack(nd))
                touch_atime(&last->link);
                cond_resched();
        } else if (atime_needs_update(&last->link, inode)) {
-               if (unlikely(unlazy_walk(nd)))
+               if (!try_to_unlazy(nd))
                        return ERR_PTR(-ECHILD);
                touch_atime(&last->link);
        }
                get = inode->i_op->get_link;
                if (nd->flags & LOOKUP_RCU) {
                        res = get(NULL, inode, &last->done);
-                       if (res == ERR_PTR(-ECHILD)) {
-                               if (unlikely(unlazy_walk(nd)))
-                                       return ERR_PTR(-ECHILD);
+                       if (res == ERR_PTR(-ECHILD) && try_to_unlazy(nd))
                                res = get(link->dentry, inode, &last->done);
-                       }
                } else {
                        res = get(link->dentry, inode, &last->done);
                }
                }
                if (unlikely(!d_can_lookup(nd->path.dentry))) {
                        if (nd->flags & LOOKUP_RCU) {
-                               if (unlazy_walk(nd))
+                               if (!try_to_unlazy(nd))
                                        return -ECHILD;
                        }
                        return -ENOTDIR;
        struct inode *inode;
        struct dentry *dentry;
        const char *res;
-       int error;
 
        nd->flags |= op->intent;
 
        } else {
                /* create side of things */
                if (nd->flags & LOOKUP_RCU) {
-                       error = unlazy_walk(nd);
-                       if (unlikely(error))
-                               return ERR_PTR(error);
+                       if (!try_to_unlazy(nd))
+                               return ERR_PTR(-ECHILD);
                }
                audit_inode(nd->name, dir, AUDIT_INODE_PARENT);
                /* trailing slashes? */
        }
 
        if (open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) {
-               error = mnt_want_write(nd->path.mnt);
-               if (!error)
-                       got_write = true;
+               got_write = !mnt_want_write(nd->path.mnt);
                /*
                 * do _not_ fail yet - we might not need that or fail with
                 * a different error; let lookup_open() decide; we'll be