Commit b29b9310 authored by Mr NeilBrown's avatar Mr NeilBrown Committed by Oleg Drokin
Browse files

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: default avatarMr NeilBrown <neilb@suse.de>
Change-Id: I8bb3d02523b5dcfadac19f01ccb736d7b7f28239
Reviewed-on: https://review.whamcloud.com/37063

Tested-by: default avatarjenkins <devops@whamcloud.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarMike Pershin <mpershin@whamcloud.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent f46646c2
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment