diff --git a/block/blk-ioc.c b/block/blk-ioc.c index 27a06e00eaec4312c5596ad58ebaa7fcc8c438ef..7490b6da24539d84c646901d7ff9b4e905bbbec2 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -204,7 +204,9 @@ void put_io_context(struct io_context *ioc, struct request_queue *locked_q) spin_unlock(last_q->queue_lock); last_q = NULL; - if (!spin_trylock(this_q->queue_lock)) + /* spin_trylock() always successes in UP case */ + if (this_q != locked_q && + !spin_trylock(this_q->queue_lock)) break; last_q = this_q; continue;