Skip to contentSkip to conversation

GFS2: drop rindex glock to refresh rindex list

PATCH New Benjamin Marzinski 2 participants 2 messages Nov 10, 2009 – Nov 11, 2009 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GFS2: drop rindex glock to refresh rindex list

When a gfs2 filesystem is grown, it needs to rebuild the rindex list to be able to use the new space. gfs2 does this when the rindex is marked not uptodate, which happens when the rindex glock is dropped. However, on a single node setup, there is never any reason to drop the rindex glock, so gfs2 never invalidates the the rindex. This patch makes gfs2 automatically drop the rindex glock after filesystem grows, so it can refresh the rindex list.

---
 fs/gfs2/aops.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fs/gfs2/aops.c +6 -2
Index: gfs2-2.6-nmw/fs/gfs2/aops.c
===================================================================
@@ -819,8 +819,10 @@ static int gfs2_stuffed_write_end(struct
 		mark_inode_dirty(inode);
 	}
 
-	if (inode == sdp->sd_rindex)
+	if (inode == sdp->sd_rindex) {
 		adjust_fs_space(inode);
+		ip->i_gh.gh_flags |= GL_NOCACHE;
+	}
 
 	brelse(dibh);
 	gfs2_trans_end(sdp);
@@ -889,8 +891,10 @@ static int gfs2_write_end(struct file *f
 		mark_inode_dirty(inode);
 	}
 
-	if (inode == sdp->sd_rindex)
+	if (inode == sdp->sd_rindex) {
 		adjust_fs_space(inode);
+		ip->i_gh.gh_flags |= GL_NOCACHE;
+	}
 
 	brelse(dibh);
 	gfs2_trans_end(sdp);
#1 lore raw

PATCH 1/1 GFS2: drop rindex glock to refresh rindex list

Hi,

Now in the -nmw git tree. Thanks,

Steve.

Quoted 41 lines · Benjamin Marzinski

When a gfs2 filesystem is grown, it needs to rebuild the rindex list to be able to use the new space. gfs2 does this when the rindex is marked not uptodate, which happens when the rindex glock is dropped. However, on a single node setup, there is never any reason to drop the rindex glock, so gfs2 never invalidates the the rindex. This patch makes gfs2 automatically drop the rindex glock after filesystem grows, so it can refresh the rindex list.

---
 fs/gfs2/aops.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: gfs2-2.6-nmw/fs/gfs2/aops.c
===================================================================

fs/gfs2/aops.c +6 -2
@@ -819,8 +819,10 @@ static int gfs2_stuffed_write_end(struct
 		mark_inode_dirty(inode);
 	}
 
-	if (inode == sdp->sd_rindex)
+	if (inode == sdp->sd_rindex) {
 		adjust_fs_space(inode);
+		ip->i_gh.gh_flags |= GL_NOCACHE;
+	}
 
 	brelse(dibh);
 	gfs2_trans_end(sdp);
@@ -889,8 +891,10 @@ static int gfs2_write_end(struct file *f
 		mark_inode_dirty(inode);
 	}
 
-	if (inode == sdp->sd_rindex)
+	if (inode == sdp->sd_rindex) {
 		adjust_fs_space(inode);
+		ip->i_gh.gh_flags |= GL_NOCACHE;
+	}
 
 	brelse(dibh);
 	gfs2_trans_end(sdp);