summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-02-16 17:31:04 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2012-02-28 10:48:02 +0100
commit718b97bd6b03445be53098e3c8f896aeebc304aa (patch)
tree17161766fe3ce26cb54e265324efec74fae946f3 /fs
parentGFS2: Fix race between lru_list and glock ref count (diff)
downloadlinux-718b97bd6b03445be53098e3c8f896aeebc304aa.tar.xz
linux-718b97bd6b03445be53098e3c8f896aeebc304aa.zip
GFS2: Read in rindex if necessary during unlink
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/inode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index a7d611b93f0f..c87faf48f0a1 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -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);