Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Peterson and committed by
Steven Whitehouse
a08fd280 08728f2d

+2 -1
+2 -1
fs/gfs2/rgrp.c
··· 699 699 if (!gfs2_glock_is_locked_by_me(gl)) { 700 700 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, 0, &ri_gh); 701 701 if (error) 702 - return error; 702 + goto out_unlock; 703 703 unlock_required = 1; 704 704 } 705 705 if (!sdp->sd_rindex_uptodate) 706 706 error = gfs2_ri_update(ip); 707 707 if (unlock_required) 708 708 gfs2_glock_dq_uninit(&ri_gh); 709 + out_unlock: 709 710 mutex_unlock(&sdp->sd_rindex_mutex); 710 711 } 711 712