Skip to content

Commit 9d9b160

Browse files
committed
gfs2: Fix glock recursion in freeze_go_xmote_bh
We must not call gfs2_consist (which does a file system withdraw) from the freeze glock's freeze_go_xmote_bh function because the withdraw will try to use the freeze glock, thus causing a glock recursion error. This patch changes freeze_go_xmote_bh to call function gfs2_assert_withdraw_delayed instead of gfs2_consist to avoid recursion. Signed-off-by: Bob Peterson <[email protected]>
1 parent a6579cb commit 9d9b160

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

fs/gfs2/glops.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -610,16 +610,13 @@ static int freeze_go_xmote_bh(struct gfs2_glock *gl)
610610
j_gl->gl_ops->go_inval(j_gl, DIO_METADATA);
611611

612612
error = gfs2_find_jhead(sdp->sd_jdesc, &head, false);
613-
if (error)
614-
gfs2_consist(sdp);
615-
if (!(head.lh_flags & GFS2_LOG_HEAD_UNMOUNT))
616-
gfs2_consist(sdp);
617-
618-
/* Initialize some head of the log stuff */
619-
if (!gfs2_withdrawn(sdp)) {
620-
sdp->sd_log_sequence = head.lh_sequence + 1;
621-
gfs2_log_pointers_init(sdp, head.lh_blkno);
622-
}
613+
if (gfs2_assert_withdraw_delayed(sdp, !error))
614+
return error;
615+
if (gfs2_assert_withdraw_delayed(sdp, head.lh_flags &
616+
GFS2_LOG_HEAD_UNMOUNT))
617+
return -EIO;
618+
sdp->sd_log_sequence = head.lh_sequence + 1;
619+
gfs2_log_pointers_init(sdp, head.lh_blkno);
623620
}
624621
return 0;
625622
}

0 commit comments

Comments
 (0)