Skip to contentSkip to conversation

Unlock rindex mutex on glock error

PATCH New Bob Peterson 2 participants 2 messages Feb 29, 2012 – Mar 1, 2012 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 12861abf-0b7d-4e06-aad9-14c0bbd06422@zmail12.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH 1/1 Unlock rindex mutex on glock error

Hi,

This patch fixes an error path in function gfs2_rindex_update that leaves the rindex mutex held.

Regards,

Bob Peterson
Red Hat File Systems

--

 fs/gfs2/rgrp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/gfs2/rgrp.c +2 -1
index 1446b4e..e09370e 100644
@@ -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);
 	}
 
#2 lore raw

PATCH 1/1 Unlock rindex mutex on glock error

Hi,

Now in the -nmw git tree. Thanks,

Steve.

Quoted 36 lines · Bob Peterson

Hi,

This patch fixes an error path in function gfs2_rindex_update that leaves the rindex mutex held.

Regards,

Bob Peterson
Red Hat File Systems

--

 fs/gfs2/rgrp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/gfs2/rgrp.c +2 -1
index 1446b4e..e09370e 100644
@@ -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);
 	}