diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-10-23 01:59:25 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-10-23 01:59:25 +0000 |
commit | 8a6a354e22521e7d2d14b8b4c2d1b7a65a0c8d5e (patch) | |
tree | 7137dc51718b7f027f55be8387b6e892007b75ae /sys/src/9 | |
parent | 9a69a14279be575bb2b7891a9d6f5da28ac2927c (diff) |
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 :(
Diffstat (limited to 'sys/src/9')
-rw-r--r-- | sys/src/9/port/sdnvme.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/9/port/sdnvme.c b/sys/src/9/port/sdnvme.c index 4f7b9ee91..9f244d9e0 100644 --- a/sys/src/9/port/sdnvme.c +++ b/sys/src/9/port/sdnvme.c @@ -113,11 +113,14 @@ qcmd(WS *ws, Ctlr *ctlr, int adm, u32int opc, u32int nsid, void *mptr, void *dat 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; |