Fix gfs2 freeze/thaw

-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEEJZs3krPW0xkhLMTc1b+f6wMTZToFAl+1Pq8UHGFncnVlbmJh
 QHJlZGhhdC5jb20ACgkQ1b+f6wMTZTqzJBAAjGHkW68x7gKyTK5bnZnNAMnqoj5E
 bMIPjJGViAL1J2kJwkNJBKXrOi3WNbLzevk+17CEfWun9HrS9FQO/e9IM0ENURY1
 44j0sLtrmecK8E8iXP/A/QS0UfAqtGGb056lNxA/e3MDfqc+kaRI99iJ0fZVheQV
 7vhSDcs/m3Oa2RPeLtCMBLHRQgot8g/X7fTJNVUxqKEYXY5IuTh4/eZl1DCaBGtB
 nhXZ2RIS4xoV5JFgX4M2DwaUS6y0pZIij86xOCR4tjVMFsBbFIC7iveSt/l/13ra
 Xyj93jtzAGSCfH2IyIv33YsynmnItI1n8P7XObLfXh+7kNhMs/hAIrvXFuHKDBx+
 iW9Y/mRdMpAFbOYQuIZjGZAMfFTddLMISpTlTEvaWqJJEDzZ8EUsRKqeA5kiQ6v/
 k+zWrIsiPtdCHYLhR3MYUWLNINFjxsnQobz0oNCpiCCZGS3Buz7zgbSnyAJSdj2x
 LK+O8PX8NCiGUCQCHsdcS4rN/sVm04ZdlA2NClN7llAtqTk73qrC2TtxiHNRIvLB
 CU7ScwYbGN2ANoNyU/PTptpo7y90OZW6m6A3/HgRyxL96kQ6nk8/33XgaIghS4Xh
 TDbjb0redp3wtVeJ6Ukgq8Nrr1XDcWKDMlp5h5KNHPApkKf2d1y51lX32PfDmWdM
 N/8OE/34bz9jCmU=
 =GWbB
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2020-11-18 12:12:18 -08:00
commit c2e7554e1b

View File

@ -571,7 +571,18 @@ static int freeze_go_sync(struct gfs2_glock *gl)
int error = 0;
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
if (gl->gl_req == LM_ST_EXCLUSIVE && !gfs2_withdrawn(sdp)) {
/*
* We need to check gl_state == LM_ST_SHARED here and not gl_req ==
* LM_ST_EXCLUSIVE. That's because when any node does a freeze,
* all the nodes should have the freeze glock in SH mode and they all
* call do_xmote: One for EX and the others for UN. They ALL must
* freeze locally, and they ALL must queue freeze work. The freeze_work
* calls freeze_func, which tries to reacquire the freeze glock in SH,
* effectively waiting for the thaw on the node who holds it in EX.
* Once thawed, the work func acquires the freeze glock in
* SH and everybody goes back to thawed.
*/
if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp)) {
atomic_set(&sdp->sd_freeze_state, SFS_STARTING_FREEZE);
error = freeze_super(sdp->sd_vfs);
if (error) {