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

Damien Le Moal <[email protected]> Tue, 28 Jul 2026 12:31:45 +0900
Newsgroups org.kernel.vger.linux-ide,org.kernel.vger.linux-scsi
Organization Western Digital Research
Message-ID <[email protected]>
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.

-- 
Damien Le Moal
Western Digital Research