提交 16222cfb 编写于 作者: H Harald Freudenberger 提交者: Martin Schwidefsky

s390/zcrypt: fix possible deadlock situation on ap queue remove

With commit 01396a37 ("s390/zcrypt: revisit ap device remove
procedure") the ap queue remove is now a two stage process. However,
a del_timer_sync() call may trigger the timer function which may
try to lock the very same spinlock as is held by the function
just initiating the del_timer_sync() call. This could end up in
a deadlock situation. Very unlikely but possible as you need to
remove an ap queue at the exact sime time when a timeout of a
request occurs.
Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
Reported-by: NPierre Morel <pmorel@linux.ibm.com>
Fixes: commit 01396a37 ("s390/zcrypt: revisit ap device remove procedure")
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 5712f330
......@@ -751,8 +751,8 @@ void ap_queue_prepare_remove(struct ap_queue *aq)
__ap_flush_queue(aq);
/* set REMOVE state to prevent new messages are queued in */
aq->state = AP_STATE_REMOVE;
del_timer_sync(&aq->timeout);
spin_unlock_bh(&aq->lock);
del_timer_sync(&aq->timeout);
}
void ap_queue_remove(struct ap_queue *aq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册