Re: [PATCH v7 1/2] ata: libata-scsi: terminate deferred commands on time out

Niklas Cassel <[email protected]> Tue, 28 Jul 2026 12:07:18 +0200
Newsgroups gmane.linux.scsi,gmane.linux.ide
Message-ID <amh_ViYTvYXVZs6U@ryzen>
On Tue, Jul 28, 2026 at 12:31:45PM +0900, Damien Le Moal wrote:
> On 7/28/26 05:40, Niklas Cassel wrote:
> > Might be a quite subtle difference, but I think it is much clearer if you
> > would instead write this as:
> > 
> > 		if (timedout_scmd && qc->scsicmd == timedout_scmd) {
> > 			host_byte = DID_TIME_OUT;
> > 			action = SCSI_EH_DONE;
> > 		} else {
> > 			host_byte = DID_REQUEUE;
> > 		}
> > 		ata_scsi_qc_done(qc, true, host_byte << 16);
> > 
> > 
> > Because that more clearly highlights the special case.
> > (And is more in line with my suggested comment, so it also makes it easier
> > to corroborate the comment with the actual code.)
> > 
> > The special case is if timedout_scmd is non-NULL AND is the deferred QC.
> > 
> > For all other cases, if timedout_scmd is non-NULL but is not the deferred
> > QC, or if the timedout_cmd is NULL, we want to requeue.
> 
> I added all your suggested comments and code changes and added the patches to
> for-7.2-fixes.

Looks good, feel free to add:
Reviewed-by: Niklas Cassel <[email protected]>

On the two patches in this series.


Kind regards,
Niklas