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

Damien Le Moal <[email protected]>
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-ide
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.