On 2020-09-21 11:48, Mike Christie wrote: > +static bool scsi_cmd_retry_allowed(struct scsi_cmnd *cmd) > +{ > + if (cmd->allowed == SCSI_CMD_RETRIES_NO_LIMIT) > + return true; > + > + return (++cmd->retries <= cmd->allowed); > +} Something minor: how about leaving out the parentheses from the above return statement? > @@ -1268,7 +1276,10 @@ int scsi_eh_get_sense(struct list_head *work_q, > * finished with the sense data, so set > * retries to the max allowed to ensure it > * won't get reissued */ > - scmd->retries = scmd->allowed; > + if (scmd->allowed == SCSI_CMD_RETRIES_NO_LIMIT) > + scmd->retries = scmd->allowed = 1; > + else > + scmd->retries = scmd->allowed; Please make sure that the comment above the if-statement remains an accurate description of the code. The comment only explains why scmd->retries is modified but not why scmd->allowed is modified if scmd->allowed == SCSI_CMD_RETRIES_NO_LIMIT. Thanks, Bart.