Message ID | 20230707092400.1336803-1-chengming.zhou@linux.dev (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [bug,report] concurrent blk_mq_complete_request() when blktests nvme/040 | expand |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 5504719b970d..a83aed2bc964 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1169,7 +1169,8 @@ static void blk_mq_raise_softirq(struct request *rq) bool blk_mq_complete_request_remote(struct request *rq) { - WRITE_ONCE(rq->state, MQ_RQ_COMPLETE); + if (cmpxchg(&rq->state, MQ_RQ_IN_FLIGHT, MQ_RQ_COMPLETE) != MQ_RQ_IN_FLIGHT) + return true; /* * For request which hctx has only one ctx mapping,