GFS2: Hash the negative dentry during inode lookup
[firefly-linux-kernel-4.4.55.git] / fs / gfs2 / inode.c
index e62e594778848ba313b17269cf9f3e7832aba0bb..9317ddc1b3c3f3624c3439fd93fcce2f762db95c 100644 (file)
@@ -840,8 +840,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
        int error;
 
        inode = gfs2_lookupi(dir, &dentry->d_name, 0);
-       if (!inode)
+       if (inode == NULL) {
+               d_add(dentry, NULL);
                return NULL;
+       }
        if (IS_ERR(inode))
                return ERR_CAST(inode);