ref: aab54bed851ba6e22c1c3b61794d3ed1065d12f5
parent: 91ec74f2d90126689bcef9e0a0ade95982a53943
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Oct 22 21:59:25 EDT 2022
sdnvme: fix missing unlock() in submit queue full case when we have more processors than submit queues, the submit queues are shared between some processors and hence we have to acquire its lock. in the case of the submit queue being full, we have to unlock it again before retrying otherwise we have a deadlock. sorry :(
--- a/sys/src/9/port/sdnvme.c
+++ b/sys/src/9/port/sdnvme.c
@@ -113,11 +113,14 @@
ws->queue = sq;
ws->link = &sq->wait[sq->tail & sq->mask];
while(*ws->link != nil){
- sched();
+ /* should be very rare */
if(!adm){
- /* should be very rare */
+ if(conf.nmach > ctlr->nsq)
+ unlock(sq);
+ sched();
goto Retry;
}
+ sched();
}
*ws->link = ws;
--
⑨