aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-11-26 09:54:29 -0700
committerJens Axboe <axboe@kernel.dk>2018-11-26 10:34:26 -0700
commitf1342709d18af97b0e71449d5696b8873d1a456c (patch)
treebb820e311b26912b1eef37a53573d52fea6dfeb1 /include/scsi
parentblk-mq: Return true if request was completed (diff)
downloadlinux-dev-f1342709d18af97b0e71449d5696b8873d1a456c.tar.xz
linux-dev-f1342709d18af97b0e71449d5696b8873d1a456c.zip
scsi: Do not rely on blk-mq for double completions
The scsi timeout error handling had been directly updating the block layer's request state to prevent a error handling and a natural completion from completing the same request twice. Fix this layering violation by having scsi control the fate of its commands with scsi owned flags rather than use blk-mq's. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_cmnd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index d6fd2aba0380..3de905e205ce 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -61,6 +61,9 @@ struct scsi_pointer {
/* flags preserved across unprep / reprep */
#define SCMD_PRESERVED_FLAGS (SCMD_UNCHECKED_ISA_DMA | SCMD_INITIALIZED)
+/* for scmd->state */
+#define SCMD_STATE_COMPLETE (1 << 0)
+
struct scsi_cmnd {
struct scsi_request req;
struct scsi_device *device;
@@ -145,6 +148,7 @@ struct scsi_cmnd {
int result; /* Status code from lower level driver */
int flags; /* Command flags */
+ unsigned long state; /* Command completion state */
unsigned char tag; /* SCSI-II queued command tag */
};