diff --git a/fs/namei.c b/fs/namei.c index a0f9a0294ff2ec8d7a764d4abee47966f8111ae7..1d60fdf01b3730c883d850f1e72136db2d044a8e 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1188,12 +1188,12 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, } 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))