Message ID | 1647945585-197349-3-git-send-email-john.garry@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | blk-mq/libata/scsi: SCSI driver tagging improvements | expand |
On Tue, Mar 22, 2022 at 06:39:36PM +0800, John Garry wrote: > Add a new type of submitter, SUBMITTED_BY_SCSI_CUSTOM_OPS, for when a > SCSI cmnd is submitted via the block layer but not by scsi_queue_rq(). > > Since this is not a true SCSI cmnd we should do nothing for it in > scsi_done_internal(). CUSTOM_OPS sounds weird. I think the naming should match the naming of whatever is used to submit it (haven't read the remaining patches yet). And this should probably be folded into the patch that actually uses it.
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a7788184908e..d230392f2b4a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1615,6 +1615,8 @@ static void scsi_done_internal(struct scsi_cmnd *cmd, bool complete_directly) return scsi_eh_done(cmd); case SUBMITTED_BY_SCSI_RESET_IOCTL: return; + case SUBMITTED_BY_SCSI_CUSTOM_OPS: + return; } if (unlikely(blk_should_fake_timeout(scsi_cmd_to_rq(cmd)->q))) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 76c5eaeeb3b5..ad4bcace1390 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -64,6 +64,7 @@ enum scsi_cmnd_submitter { SUBMITTED_BY_BLOCK_LAYER = 0, SUBMITTED_BY_SCSI_ERROR_HANDLER = 1, SUBMITTED_BY_SCSI_RESET_IOCTL = 2, + SUBMITTED_BY_SCSI_CUSTOM_OPS = 3, } __packed; struct scsi_cmnd {
Add a new type of submitter, SUBMITTED_BY_SCSI_CUSTOM_OPS, for when a SCSI cmnd is submitted via the block layer but not by scsi_queue_rq(). Since this is not a true SCSI cmnd we should do nothing for it in scsi_done_internal(). Signed-off-by: John Garry <john.garry@huawei.com> --- drivers/scsi/scsi_lib.c | 2 ++ include/scsi/scsi_cmnd.h | 1 + 2 files changed, 3 insertions(+)