[PATCH 9/9] scsi: Add blk_request_aborted check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a blk_request_aborted check to scsi_requeue_request. This allows for a
single check in a common requeue function to determine if a request has been
aborted.

Signed-off-by: Mike Anderson <andmike@xxxxxxxxxxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxx>
---
 drivers/scsi/scsi_lib.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 73182db..68e4bd7 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -121,11 +121,19 @@ static void scsi_requeue_request(struct request_queue *q, struct request *req,
 	unsigned long flags;
 
 	spin_lock_irqsave(q->queue_lock, flags);
+	if (blk_request_aborted(req)) {
+		spin_unlock_irqrestore(q->queue_lock, flags);
+		scsi_unprep_fn(q, req);
+		blk_end_request_all(req, -EIO);
+		goto out;
+	}
+
 	if (unprep)
 		scsi_unprep_request(req);
 	blk_requeue_request(q, req);
 	spin_unlock_irqrestore(q->queue_lock, flags);
 
+out:
 	scsi_run_queue(q);
 }
 
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux