summaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-02-29 15:15:14 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2012-03-01 09:25:21 +0000
commita08fd280b58836c910a4af10eee2066e358d16db (patch)
treebc3c614014490eaad0c1be3abb0e3c0cf9fada5d /fs/gfs2
parent08728f2d8b0ebf01618d3d63e69966f7d43859b9 (diff)
downloadlinux-a08fd280b58836c910a4af10eee2066e358d16db.tar.bz2
GFS2: Unlock rindex mutex on glock error
This patch fixes an error path in function gfs2_rindex_update that leaves the rindex mutex held. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/rgrp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 1446b4e0ac73..e09370eec590 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -699,13 +699,14 @@ int gfs2_rindex_update(struct gfs2_sbd *sdp)
if (!gfs2_glock_is_locked_by_me(gl)) {
error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);
if (error)
- return error;
+ goto out_unlock;
unlock_required = 1;
}
if (!sdp->sd_rindex_uptodate)
error = gfs2_ri_update(ip);
if (unlock_required)
gfs2_glock_dq_uninit(&ri_gh);
+out_unlock:
mutex_unlock(&sdp->sd_rindex_mutex);
}