if (need_mntput && path->mnt == mnt)
mntput(path->mnt);
- if (ret == -EISDIR)
- ret = 0;
+ if (ret == -EISDIR || !ret)
+ ret = 1;
if (need_mntput)
nd->flags |= LOOKUP_JUMPED;
if (unlikely(ret < 0))
if (unlikely(!dentry)) {
if (unlazy_walk(nd, NULL, 0))
return -ECHILD;
- return 1;
+ return 0;
}
/*
path->mnt = mnt;
path->dentry = dentry;
if (likely(__follow_mount_rcu(nd, path, inode, seqp)))
- return 0;
+ return 1;
if (unlazy_walk(nd, dentry, seq))
return -ECHILD;
}
} else {
dentry = __d_lookup(parent, &nd->last);
if (unlikely(!dentry))
- return 1;
+ return 0;
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
status = d_revalidate(dentry, nd->flags);
}
if (unlikely(status <= 0)) {
- if (!status) {
+ if (!status)
d_invalidate(dentry);
- status = 1;
- }
dput(dentry);
return status;
}
path->mnt = mnt;
path->dentry = dentry;
err = follow_managed(path, nd);
- if (likely(!err))
+ if (likely(err > 0))
*inode = d_backing_inode(path->dentry);
return err;
}
return err;
}
err = lookup_fast(nd, &path, &inode, &seq);
- if (unlikely(err)) {
+ if (unlikely(err <= 0)) {
if (err < 0)
return err;
nd->flags |= LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
/* we _can_ be in RCU mode here */
error = lookup_fast(nd, &path, &inode, &seq);
- if (likely(!error))
+ if (likely(error > 0))
goto finish_lookup;
if (error < 0)