Skip to contentSkip to conversation

GFS2: move sleep outside the spinlock

PATCH New [email protected] 1 participant 1 message Jan 21, 2022 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GFS2: move sleep outside the spinlock

From: Lv Ruyi <[email protected]>

Don't sleep with spinlock held, so move it outside critical section.

---
 fs/gfs2/lock_dlm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/gfs2/lock_dlm.c +2 -1
index 50578f881e6d..e43b33b115b4 100644
@@ -942,14 +942,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.25.1