Re: [PATCH] ata: libata-eh: Fix detection of deferred qc timeouts
From: Niklas Cassel
Date: Fri Mar 06 2026 - 04:08:10 EST
On Thu, Mar 05, 2026 at 06:48:05PM -0800, Guenter Roeck wrote:
> If the `ata_qc_for_each_raw()` loop finishes without finding a matching
> `scmd`, `qc` will hold a pointer to the last element examined, which is
> accociated with `i == ATA_MAX_QUEUE - 1`. This element can match
> `ap->deferred_qc`. If that happens, the condition `qc == ap->deferred_qc`
> evaluates to true despite the loop not breaking on a scmd match.
> In that case, the error handler mistakenly intercepts a command that
> completed normally after an unrelated SCSI timeout, returning a timeout
> error instead of success.
>
> [...]
Applied commit log changes from Damien and myself.
Applied to libata/linux.git (libata-for-7.0-fixes), thanks!
[1/1] ata: libata-eh: Fix detection of deferred qc timeouts
https://git.kernel.org/libata/linux/c/ee0e6e69
Kind regards,
Niklas