GFS2: Hash the negative dentry during inode lookup
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 10 Sep 2014 18:09:20 +0000 (14:09 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 11 Sep 2014 09:54:43 +0000 (10:54 +0100)
Fix a regression introduced by:
6d4ade986f9c8df31e68 GFS2: Add atomic_open support
where an early return misses d_splice_alias() which had been
adding the negative dentry.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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);