From eb265e4a8e557724740a4725551c573e881bf243 Mon Sep 17 00:00:00 2001 From: Gilad Broner Date: Mon, 2 Feb 2015 15:20:14 +0200 Subject: [PATCH] Revert "block: do not requeue completed request" This reverts change Ia3e8209959fe377281f28106640a13f10501b47e. Disabling requeueing of a completed request will cause a request not to be retried (by requeueing it) in cases where the low-level driver detected some error but finished processing of the requeust. Specifically, not retrying the request will cause calls to functions such as blk_execute_rq to block forever. Change-Id: Ie0e97cb7560385d48d022dd4ae09f96cfd75b752 Signed-off-by: Gilad Broner --- block/blk-core.c | 15 +-------------- block/blk.h | 5 ----- include/linux/blkdev.h | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 57cb83f588ac..bce8d736b41e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1214,21 +1214,9 @@ EXPORT_SYMBOL(blk_make_request); * Drivers often keep queueing requests until the hardware cannot accept * more, when that condition happens we need to put the request back * on the queue. Must be called with queue lock held. - * - * Return: true is request was requeued, false otherwise */ -bool blk_requeue_request(struct request_queue *q, struct request *rq) +void blk_requeue_request(struct request_queue *q, struct request *rq) { - /* - * Request could have timed out at this point and error handling is - * now in progress so it is marked as completed. Do not allow to - * requeue a completed request as this will cause the tag to end and - * become -1. However, the request is still active and being used so tag - * being -1 is not valid. - */ - if (blk_is_req_complete(rq)) - return false; - blk_delete_timer(rq); blk_clear_rq_complete(rq); trace_block_rq_requeue(q, rq); @@ -1249,7 +1237,6 @@ bool blk_requeue_request(struct request_queue *q, struct request *rq) q->dispatched_urgent = false; } elv_requeue_request(q, rq); - return true; } EXPORT_SYMBOL(blk_requeue_request); diff --git a/block/blk.h b/block/blk.h index bc1eafe44862..4e6aae4a139c 100644 --- a/block/blk.h +++ b/block/blk.h @@ -58,11 +58,6 @@ static inline void blk_clear_rq_complete(struct request *rq) clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); } -static inline bool blk_is_req_complete(struct request *rq) -{ - return test_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); -} - /* * Internal elevator interface */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1a251d543be2..059c0409d952 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -740,7 +740,7 @@ extern void __blk_put_request(struct request_queue *, struct request *); extern struct request *blk_get_request(struct request_queue *, int, gfp_t); extern struct request *blk_make_request(struct request_queue *, struct bio *, gfp_t); -extern bool blk_requeue_request(struct request_queue *, struct request *); +extern void blk_requeue_request(struct request_queue *, struct request *); extern int blk_reinsert_request(struct request_queue *q, struct request *rq); extern bool blk_reinsert_req_sup(struct request_queue *q); extern void blk_add_request_payload(struct request *rq, struct page *page,