Christian Franke wrote:
The problem is that no errno is offered for "unspecified" errors

IMHO the problem is the existence of "unspecified" errors. Ddrescue needs that the system returns 2 different kinds of errors: non-fatal (temporary or affecting just a sector, for example) and fatal (permanent, like EACCES "Permission denied").

If the system returns a fatal error code for a non-fatal error, ddrescue quits prematurely.

If the system returns a non-fatal error code for a fatal error, ddrescue marks the rest of the drive as "bad-sector" and rescues nothing.

and interestingly also not for "media changed".

Maybe ESTALE could be used for "media changed".

Any suggestion for a better fallback errno?

Once the system mixes fatal and non-fatal errors (for example by returning ERROR_MEDIA_CHANGED instead of EIO) any mapping will make ddrescue behave incorrectly one way or the other.

In addition to all this, option '-O, --reopen-on-error' only has effect during the copying phase, when data are copied in large blocks. Therefore the proposed '--continue-on-errno' would make ddrescue behave incorrectly during trimming, scraping, and retrying.

Therefore I propose the following simpler change:
Great, this would help.

OK. I'll release a test version as soon as I have it implemented.

For diagnostics of possible other "interesting" behavior, it would also
be helpful to see an errno if interpreted as non-fatal but with
unexpected value, e.g. different from EIO.

The problem is to find a way for ddrescue to show such errno values, as there may be thousands of failed reads per second. (Maybe adding an errno field to the output of '--log-reads').

Best regards,

Reply via email to