diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2010-11-23 23:52:55 -0600 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2010-11-30 15:41:54 +0000 |
commit | 086d8334cf73b3bb695b82dd864a7a8b00d96b7e (patch) | |
tree | acadf5458a2ccfde44049bcb7ba63e136844f875 /fs/gfs2/bmap.c | |
parent | 0489b3f5eba735413ccedd425651cf41d6b1f7c5 (diff) | |
download | linux-086d8334cf73b3bb695b82dd864a7a8b00d96b7e.tar.bz2 |
GFS2: fix recursive locking during rindex truncates
When you truncate the rindex file, you need to avoid calling gfs2_rindex_hold,
since you already hold it. However, if you haven't already read in the
resource groups, you need to do that.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | fs/gfs2/bmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 5476c066d4ee..ae7d205de0d1 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -780,7 +780,11 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, if (metadata) revokes = (height) ? sdp->sd_inptrs : sdp->sd_diptrs; - error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); + if (ip != GFS2_I(sdp->sd_rindex)) + error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); + else if (!sdp->sd_rgrps) + error = gfs2_ri_update(ip); + if (error) return error; @@ -879,7 +883,8 @@ out_rg_gunlock: out_rlist: gfs2_rlist_free(&rlist); out: - gfs2_glock_dq_uninit(&ip->i_alloc->al_ri_gh); + if (ip != GFS2_I(sdp->sd_rindex)) + gfs2_glock_dq_uninit(&ip->i_alloc->al_ri_gh); return error; } |