Skip to contentSkip to conversation

GFS2: Hash the negative dentry during inode lookup

PATCH New Benjamin Coddington 2 participants 2 messages Sep 10, 2014 – Sep 11, 2014 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GFS2: Hash the negative dentry during inode lookup

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.

---
 fs/gfs2/inode.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/gfs2/inode.c +3 -1
index e62e594..9317ddc 100644
@@ -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);
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 GFS2: Hash the negative dentry during inode lookup

Hi,

Quoted 16 lines · Benjamin Coddington

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.

---
  fs/gfs2/inode.c |    4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
fs/gfs2/inode.c +0 -0
index e62e594..9317ddc 100644
@@ -840,8 +840,10 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry,
  	int error;

fs/gfs2/inode.c static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, · line 849

Quoted 10 lines
fs/gfs2/inode.c +3 -1
 
  	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);
 

Now in the GFS2 -nmw tree, and I've added Bob's signed-off-by too. Thanks,

Steve.