Re: [PATCH] ata: libata-eh: Do not retry reset if the device is gone

Niklas Cassel
2026-04-02T08:55:45Z

On Wed, Apr 01, 2026 at 06:11:01PM -0700, Igor Pylypiv wrote:
> If a device is hot-unplugged or otherwise disappears during error handling,
> ata_eh_reset() may fail with -ENODEV. Currently, the error handler will
> continue to retry the reset operation up to max_tries times.
>
> Prevent unnecessary reset retries by exiting the loop early when
> ata_eh_reset() returns -ENODEV.

ata_do_reset() ?

The loop is inside ata_eh_reset(), so it sounds a bit weird to exit
the loop early if the function itself returns -ENODEV.

I guess you could also write it like:
Prevent unnecessary reset retries by exiting the loop early when
a callee in ata_eh_reset() returns -ENODEV.

Kind regards,
Niklas