diff --git a/fs/namei.c b/fs/namei.c index c87c14ee1a25..dadba8017c04 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4750,8 +4750,7 @@ static struct dentry *lookup_fast_for_open(struct nameidata *nd, int open_flag) return dentry; if (open_flag & O_CREAT) { - /* Discard negative dentries. Need inode_lock to do the create */ - if (!dentry->d_inode) { + if (d_is_negative(dentry)) { if (!(nd->flags & LOOKUP_RCU)) dput(dentry); dentry = NULL;