Skip to contentSkip to conversation

block: free bios when failing blk_execute_rq_nowait calls

PATCH In review [email protected] 2 participants 2 messages Sep 18, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: free bios when failing blk_execute_rq_nowait calls

From: Mike Christie <[email protected]>

If the queue is dying then we only call the rq->end_io callout. This leaves bios setup on the request, because the caller assumes when the blk_execute_rq_nowait/blk_execute_rq call has completed that the rq->bios have been cleaned up.

This patch has blk_execute_rq_nowait use __blk_end_request_all to free bios and also call rq->end_io.

---
 block/blk-exec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
block/blk-exec.c +2 -2
index e706213..ae4f27d 100644
@@ -68,9 +68,9 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
 	spin_lock_irq(q->queue_lock);
 
 	if (unlikely(blk_queue_dying(q))) {
+		rq->cmd_flags |= REQ_QUIET; 
 		rq->errors = -ENXIO;
-		if (rq->end_io)
-			rq->end_io(rq, rq->errors);
+		__blk_end_request_all(rq, rq->errors);
 		spin_unlock_irq(q->queue_lock);
 		return;
 	}
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 9 lines · On Wed, Sep 18 2013, [email protected] wrote:

From: Mike Christie <[email protected]>

If the queue is dying then we only call the rq->end_io callout. This leaves bios setup on the request, because the caller assumes when the blk_execute_rq_nowait/blk_execute_rq call has completed that the rq->bios have been cleaned up.

This patch has blk_execute_rq_nowait use __blk_end_request_all to free bios and also call rq->end_io.

Thanks Mike, applied.

Signature · 1 line
Jens Axboe