Guenter Roeck
ee0e6e69a7
ata: libata-eh: Fix detection of deferred qc timeouts
...
If the ata_qc_for_each_raw() loop finishes without finding a matching SCSI
command for any QC, the variable qc will hold a pointer to the last element
examined, which has the tag i == ATA_MAX_QUEUE - 1. This qc can match the
port deferred QC (ap->deferred_qc).
If that happens, the condition qc == ap->deferred_qc evaluates to true
despite the loop not breaking with a match on the SCSI command for this QC.
In that case, the error handler mistakenly intercepts a command that has
not been issued yet and that has not timed out, and thus erroneously
returning a timeout error.
Fix the problem by checking for i < ATA_MAX_QUEUE in addition to
qc == ap->deferred_qc.
The problem was found by an experimental code review agent based on
gemini-3.1-pro while reviewing backports into v6.18.y.
Assisted-by: Gemini:gemini-3.1-pro
Fixes: eddb98ad93 ("ata: libata-eh: correctly handle deferred qc timeouts")
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
[cassel: modified commit log as suggested by Damien]
Reviewed-by: Damien Le Moal <dlemoal@kernel.org >
Signed-off-by: Niklas Cassel <cassel@kernel.org >
2026-03-06 09:58:47 +01:00
..
2026-02-21 17:09:51 -08:00
2024-10-30 16:07:36 -05:00
2025-01-09 17:52:17 +09:00
2025-01-09 17:52:17 +09:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2026-01-08 17:42:56 +09:00
2026-01-08 17:43:00 +09:00
2024-10-17 09:55:08 +02:00
2024-10-17 09:55:08 +02:00
2023-08-02 17:37:06 +09:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2025-01-15 15:21:27 +01:00
2024-10-17 09:55:08 +02:00
2024-10-17 09:55:08 +02:00
2026-01-08 17:43:04 +09:00
2026-01-13 22:00:02 +09:00
2025-08-26 07:44:32 +09:00
2024-12-03 05:10:20 +01:00
2025-07-31 12:56:21 +09:00
2026-02-02 13:47:37 +09:00
2026-02-21 20:03:00 -08:00
2025-07-31 12:56:21 +09:00
2026-02-21 17:09:51 -08:00
2026-03-05 16:49:02 +01:00
2026-03-06 09:58:47 +01:00
2020-03-26 10:28:19 -06:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-03-04 10:42:12 +01:00
2025-11-07 09:42:36 +01:00
2023-01-04 13:36:26 +09:00
2026-02-21 17:09:51 -08:00
2024-07-04 11:52:31 +02:00
2026-02-21 17:09:51 -08:00
2026-02-12 17:12:43 -08:00
2023-02-22 13:35:51 -08:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2024-12-03 05:10:20 +01:00
2023-08-24 08:09:59 +09:00
2023-03-24 19:19:19 -04:00
2023-03-24 19:19:19 -04:00
2024-07-30 07:10:30 +09:00
2023-03-24 19:19:19 -04:00
2023-03-24 19:19:19 -04:00
2025-06-10 14:26:27 +02:00
2026-02-02 13:47:40 +09:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2026-02-04 12:23:23 +01:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2023-03-24 19:19:19 -04:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2023-11-20 09:22:26 +09:00
2025-10-23 14:23:40 +02:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2026-02-02 13:47:37 +09:00
2025-08-01 08:43:08 +09:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2023-03-24 19:19:19 -04:00
2023-03-24 19:19:19 -04:00
2025-07-16 09:31:43 +02:00
2023-07-28 08:52:42 +09:00
2025-07-16 09:31:43 +02:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-11-18 21:58:41 +01:00
2023-03-24 19:19:19 -04:00
2025-08-01 08:43:11 +09:00
2024-12-03 05:10:20 +01:00
2024-10-17 09:55:08 +02:00
2025-04-08 12:36:03 +09:00
2024-10-01 09:22:02 +02:00
2024-10-17 09:55:08 +02:00
2025-07-16 09:31:43 +02:00
2023-03-24 19:19:19 -04:00
2023-03-24 19:19:19 -04:00
2023-03-24 19:19:19 -04:00
2024-07-30 07:10:08 +09:00
2023-03-24 19:19:19 -04:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2024-12-16 22:36:27 +09:00
2024-12-11 13:18:25 +09:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2019-05-21 11:28:46 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-04 10:36:00 +02:00
2025-01-18 14:38:49 -06:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-07-16 09:31:43 +02:00
2025-01-18 14:38:49 -06:00