From b29b9310dafe17ba78e1db490b79b89d2d6fdcd1 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Thu, 19 Dec 2019 16:55:35 +1100 Subject: [PATCH] LU-13088 ldlm: Fix sleeping function called in atomic target_recovery_overseer() can sleep while holding a spinlock, which triggers a BUG warning. It is easily fixed by dropping the spinlock before waiting. In the case where the task waits, no useful information that could be protected by the spinlock is held, so nothing can be lost by dropping it. Signed-off-by: Mr NeilBrown Change-Id: I8bb3d02523b5dcfadac19f01ccb736d7b7f28239 Reviewed-on: https://review.whamcloud.com/37063 Tested-by: jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/ldlm/ldlm_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index b70bd26..5ee714e 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -2118,11 +2118,13 @@ repeat: * yet, let's wait those threads stopped */ if (next_update_transno == 0) { + spin_unlock(&obd->obd_recovery_task_lock); wait_event_idle( tdtd->tdtd_recovery_threads_waitq, atomic_read(&tdtd->tdtd_recovery_threads_count) == 0); + spin_lock(&obd->obd_recovery_task_lock); next_update_transno = distribute_txn_get_next_transno( lut->lut_tdtd); -- 1.8.3.1