Skip to content

Commit c2e7554

Browse files
committed
Merge tag 'gfs2-v5.10-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 fix from Andreas Gruenbacher: "Fix gfs2 freeze/thaw" * tag 'gfs2-v5.10-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Fix regression in freeze_go_sync
2 parents ce228d4 + 20b3291 commit c2e7554

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

fs/gfs2/glops.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,18 @@ static int freeze_go_sync(struct gfs2_glock *gl)
571571
int error = 0;
572572
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
573573

574-
if (gl->gl_req == LM_ST_EXCLUSIVE && !gfs2_withdrawn(sdp)) {
574+
/*
575+
* We need to check gl_state == LM_ST_SHARED here and not gl_req ==
576+
* LM_ST_EXCLUSIVE. That's because when any node does a freeze,
577+
* all the nodes should have the freeze glock in SH mode and they all
578+
* call do_xmote: One for EX and the others for UN. They ALL must
579+
* freeze locally, and they ALL must queue freeze work. The freeze_work
580+
* calls freeze_func, which tries to reacquire the freeze glock in SH,
581+
* effectively waiting for the thaw on the node who holds it in EX.
582+
* Once thawed, the work func acquires the freeze glock in
583+
* SH and everybody goes back to thawed.
584+
*/
585+
if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp)) {
575586
atomic_set(&sdp->sd_freeze_state, SFS_STARTING_FREEZE);
576587
error = freeze_super(sdp->sd_vfs);
577588
if (error) {

0 commit comments

Comments
 (0)