Skip to contentSkip to conversation

three little req->errors follow ups

PATCH In review Christoph Hellwig 4 participants 9 messages Apr 26, 2017

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

While moving forward with the block error work I noticed three more places that pass non-errno values to the end_request variants, and never actually check those return values. This little series fixes those up to always pass 0.

#1 lore raw

PATCH 1/3 scsi_transport_sas: always pass 0 error to blk_end_request_all

The SAS transport queues are only used by bsg, and bsg always looks at the scsi_request results and never add the error passed in the end_io callback.

---
 drivers/scsi/scsi_transport_sas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_sas.c +1 -1
index a2b279737a4b..9fdbd50c31b4 100644
@@ -186,7 +186,7 @@ static void sas_smp_request(struct request_queue *q, struct Scsi_Host *shost,
 		ret = handler(shost, rphy, req);
 		scsi_req(req)->result = ret;
 
-		blk_end_request_all(req, ret);
+		blk_end_request_all(req, 0);
 
 		spin_lock_irq(q->queue_lock);
 	}
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/3 ide-pm: always pass 0 error to __blk_end_request_all

In reply to Christoph Hellwig

ide_pm_execute_rq exectures a PM request synchronously, and in the failure case where it calls __blk_end_request_all it never checks the error field passed to the end_io callback, so don't bother setting it.

---
 drivers/ide/ide-pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ide/ide-pm.c +1 -1
index 277c2bb7616f..0977fc1f40ce 100644
@@ -57,7 +57,7 @@ static int ide_pm_execute_rq(struct request *rq)
 	if (unlikely(blk_queue_dying(q))) {
 		rq->rq_flags |= RQF_QUIET;
 		scsi_req(rq)->result = -ENXIO;
-		__blk_end_request_all(rq, scsi_req(rq)->result);
+		__blk_end_request_all(rq, 0);
 		spin_unlock_irq(q->queue_lock);
 		return -ENXIO;
 	}
Signature · 1 line
2.11.0
Reviewed-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] ide-pm: always pass 0 error to __blk_end_request_all

Quoted 5 lines · Christoph Hellwig

ide_pm_execute_rq exectures a PM request synchronously, and in the failure case where it calls __blk_end_request_all it never checks the error field passed to the end_io callback, so don't bother setting it.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Acked-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] ide-pm: always pass 0 error to __blk_end_request_all

In reply to Christoph Hellwig

From: Christoph Hellwig <[email protected]>
Date: Wed, 26 Apr 2017 09:34:21 +0200

Quoted 5 lines

ide_pm_execute_rq exectures a PM request synchronously, and in the failure case where it calls __blk_end_request_all it never checks the error field passed to the end_io callback, so don't bother setting it.

#5 lore raw

PATCH 3/3 ide-pm: always pass 0 error to ide_complete_rq in ide_do_devset

In reply to Christoph Hellwig

The caller only looks at the scsi_request result field anyway.

---
 drivers/ide/ide-devsets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ide/ide-devsets.c +1 -1
index b1223234037d..9b69c32ee560 100644
@@ -187,6 +187,6 @@ ide_startstop_t ide_do_devset(ide_drive_t *drive, struct request *rq)
 	err = setfunc(drive, *(int *)&scsi_req(rq)->cmd[1]);
 	if (err)
 		scsi_req(rq)->result = err;
-	ide_complete_rq(drive, err, blk_rq_bytes(rq));
+	ide_complete_rq(drive, 0, blk_rq_bytes(rq));
 	return ide_stopped;
 }
Signature · 1 line
2.11.0
maintainer Applied
#8 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

While moving forward with the block error work I noticed three more places that pass non-errno values to the end_request variants, and never actually check those return values. This little series fixes those up to always pass 0.

Applied, thanks.

Signature · 1 line
Jens Axboe