Skip to content

Commit

Permalink
GFS2: drop rindex glock to refresh rindex list
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Benjamin Marzinski authored and Steven Whitehouse committed Dec 3, 2009
1 parent 0ab7d13 commit 9ae3c6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/gfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,10 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
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);
Expand Down Expand Up @@ -889,8 +891,10 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
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);
Expand Down

0 comments on commit 9ae3c6d

Please sign in to comment.