Skip to content

Commit

Permalink
GFS2: Read in rindex if necessary during unlink
Browse files Browse the repository at this point in the history
This patch fixes a problem whereby you were unable to delete
files until other file system operations were done (such as
statfs, touch, writes, etc.) that caused the rindex to be
read in.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Feb 28, 2012
1 parent 4043b88 commit 718b97b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,14 +1035,19 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)
struct buffer_head *bh;
struct gfs2_holder ghs[3];
struct gfs2_rgrpd *rgd;
int error = -EROFS;
int error;

error = gfs2_rindex_update(sdp);
if (error)
return error;
gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs);
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, ghs + 1);

rgd = gfs2_blk2rgrpd(sdp, ip->i_no_addr);
if (!rgd)
if (!rgd) {
error = -EROFS;
goto out_inodes;
}
gfs2_holder_init(rgd->rd_gl, LM_ST_EXCLUSIVE, 0, ghs + 2);


Expand Down

0 comments on commit 718b97b

Please sign in to comment.