Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a08fd280 authored by Bob Peterson's avatar Bob Peterson Committed by Steven Whitehouse
Browse files

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: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 08728f2d
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -699,13 +699,14 @@ int gfs2_rindex_update(struct gfs2_sbd *sdp)
		if (!gfs2_glock_is_locked_by_me(gl)) {
		if (!gfs2_glock_is_locked_by_me(gl)) {
			error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);
			error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh);
			if (error)
			if (error)
				return error;
				goto out_unlock;
			unlock_required = 1;
			unlock_required = 1;
		}
		}
		if (!sdp->sd_rindex_uptodate)
		if (!sdp->sd_rindex_uptodate)
			error = gfs2_ri_update(ip);
			error = gfs2_ri_update(ip);
		if (unlock_required)
		if (unlock_required)
			gfs2_glock_dq_uninit(&ri_gh);
			gfs2_glock_dq_uninit(&ri_gh);
out_unlock:
		mutex_unlock(&sdp->sd_rindex_mutex);
		mutex_unlock(&sdp->sd_rindex_mutex);
	}
	}