gfs2: move msleep to sleepable context
Subsystems (2)
PATCH v2 1/1 gfs2: move msleep to sleepable context
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.
Fixes 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")
Suggested-by Andreas Gruenbacher <[email protected]>
Signed-off-by Alexander Aring <[email protected]>
---
changes since v2:
- move the spinlock around to avoid schedule under spinlock
fs/gfs2/lock_dlm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/gfs2/lock_dlm.c +2 -1
@@ -996,14 +996,15 @@ static int control_mount(struct gfs2_sbd *sdp)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; }
Signature · 1 line
2.43.0
Quoted 37 lines · Alexander Aring
This patch moves the
msleep_interruptible()out of the non-sleepable context by moving thels->ls_recover_spinspinlock around somsleep_interruptible()will be called in a sleepable context.Fixes 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")Suggested-by Andreas Gruenbacher <[email protected]>Signed-off-by Alexander Aring <[email protected]>---
changes since v2:
- move the spinlock around to avoid schedule under spinlockfs/gfs2/lock_dlm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/gfs2/lock_dlm.c +2
-2@@ -996,14 +996,15 @@ static int control_mount(struct gfs2_sbd *sdp)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; } --
Quoted 1 line
2.43.0
Pushed to for-next, thanks.
Andreas