gfs2: move msleep to sleepable context
authorAlexander Aring <aahringo@redhat.com>
Mon, 31 Mar 2025 23:03:24 +0000 (19:03 -0400)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 21 Apr 2025 16:20:36 +0000 (18:20 +0200)
This patch moves the msleep_interruptible() out of the non-sleepable
context by moving the ls->ls_recover_spin spinlock around so
msleep_interruptible() will be called in a sleepable context.

Cc: stable@vger.kernel.org
Fixes: 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")
Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/lock_dlm.c

index 58aeeae7ed8cd0624f46fa3d22c55943ec242dd1..2c9172dd41e7ee8cb91e75ca2cb6dfa5e35a6e29 100644 (file)
@@ -996,14 +996,15 @@ locks_done:
                if (sdp->sd_args.ar_spectator) {
                        fs_info(sdp, "Recovery is required. Waiting for a "
                                "non-spectator to mount.\n");
+                       spin_unlock(&ls->ls_recover_spin);
                        msleep_interruptible(1000);
                } else {
                        fs_info(sdp, "control_mount wait1 block %u start %u "
                                "mount %u lvb %u flags %lx\n", block_gen,
                                start_gen, mount_gen, lvb_gen,
                                ls->ls_recover_flags);
+                       spin_unlock(&ls->ls_recover_spin);
                }
-               spin_unlock(&ls->ls_recover_spin);
                goto restart;
        }