Commit 2edd2c74 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

blk-mq: remove unnecessary blk_clear_rq_complete()

This patch removes two unnecessary blk_clear_rq_complete(),
the REQ_ATOM_COMPLETE flag is cleared inside blk_mq_start_request(),
so:

	- The blk_clear_rq_complete() in blk_flush_restore_request()
	needn't because the request will be freed later, and clearing
	it here may open a small race window with timeout.

	- The blk_clear_rq_complete() in blk_mq_requeue_request() isn't
	necessary too, even though REQ_ATOM_STARTED is cleared in
	__blk_mq_requeue_request(), in theory it still may cause a small
	race window with timeout since the two clear_bit() may be
	reordered.
Signed-off-by: default avatarMing Lei <ming.lei@canoical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 0152fb6b
...@@ -126,8 +126,6 @@ static void blk_flush_restore_request(struct request *rq) ...@@ -126,8 +126,6 @@ static void blk_flush_restore_request(struct request *rq)
/* make @rq a normal request */ /* make @rq a normal request */
rq->cmd_flags &= ~REQ_FLUSH_SEQ; rq->cmd_flags &= ~REQ_FLUSH_SEQ;
rq->end_io = rq->flush.saved_end_io; rq->end_io = rq->flush.saved_end_io;
blk_clear_rq_complete(rq);
} }
static bool blk_flush_queue_rq(struct request *rq, bool add_front) static bool blk_flush_queue_rq(struct request *rq, bool add_front)
......
...@@ -439,7 +439,6 @@ static void __blk_mq_requeue_request(struct request *rq) ...@@ -439,7 +439,6 @@ static void __blk_mq_requeue_request(struct request *rq)
void blk_mq_requeue_request(struct request *rq) void blk_mq_requeue_request(struct request *rq)
{ {
__blk_mq_requeue_request(rq); __blk_mq_requeue_request(rq);
blk_clear_rq_complete(rq);
BUG_ON(blk_queued_rq(rq)); BUG_ON(blk_queued_rq(rq));
blk_mq_add_to_requeue_list(rq, true); blk_mq_add_to_requeue_list(rq, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment