Re: [PATCH v4 02/36] scsi: Allow passthrough to override what errors to retry

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

 



On 10/16/22 12:59, Mike Christie wrote:
+/**
+ * scsi_check_passthrough - Determine if passthrough scsi_cmnd needs a retry.
+ * @scmd: scsi_cmnd to check.
+ *
+ * Return value:
+ *	SCSI_RETURN_NOT_HANDLED - if the caller should process the command
+ *	because there is no error or the passthrough user wanted the default
+ *	error processing.
+ *	SUCCESS, FAILED or NEEDS_RETRY - if this function has determined the
+ *	command should be completed, go through the erorr handler due to
+ *	missing sense or should be retried.

erorr -> error?

+static enum scsi_disposition scsi_check_passthrough(struct scsi_cmnd *scmd)
+{
+	struct scsi_failure *failure;
+	struct scsi_sense_hdr sshdr;
+	enum scsi_disposition ret;
+	enum sam_status status;
+	int i;
+
+	if (!scmd->result || !scmd->failures)
+		return SCSI_RETURN_NOT_HANDLED;
+
+	for (i = 0, failure = &scmd->failures[i]; failure->result;
+	     failure = &scmd->failures[++i]) {

Since the cmd->failures array has a sentinel, can the local variable 'i' be left out by changing "failure = &scmd->failures[++i]" into "failure++"?

+#define SCMD_FAILURE_NONE	0

Is there any patch in this patch series that uses this constant? If not, please remove it.

+#define SCMD_FAILURE_ANY	0x7fffffff

Please consider embedding the word "result" in the name of the above constant, e.g. SCMD_ANY_RESULT_FAILURE or SCMD_RESULT_FAILURE_ANY or SCMD_FAILURE_RESULT_ANY.

Thanks,

Bart.



[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