bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion about error control


From: Antonio Diaz Diaz
Subject: Re: Suggestion about error control
Date: Tue, 02 Jun 2020 01:06:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

Hello kickman.

Thanks for your message and sorry for the late answer. I have been very busy.

anonymous wrote:
The two last can recognize and distinguish the error codes got from the
kernel after every read /write request. For example, when hddsuperclone
detects the disk is offline (not ready) - it just waits for it to become
ready again. So DMDE does. It shows different error codes allowing the
operator to make the right decision about what to do. But my favourite
tool ddrescue never made such a difference to the error codes! Either the
error code was "CRC error" or "Device not ready!"

I suppose those tools (hddsuperclone and DMDE) use non-portable ways to get those codes, because neither "CRC error" nor "Device not ready!" appear among the error codes returned by 'read'[1].

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html

Bypassing the kernel should not be done lightly on POSIX systems. As a portable program, ddrescue must limit itself to the error codes returned by 'read' as documented by POSIX. As a first approximation, 'EIO' may correspond to 'CRC error' and 'ENXIO' seems the best match for 'Device not ready'.

I'll implement some form of differential response to error codes in the next version of ddrescue. Maybe ddrescue could stop or ask the user when readblockp sets errno to EBADF, ESPIPE, or ENXIO, for example.

It may be also possible to implement a non-portable way to retrieve the drive status, and compile it conditionally with '--enable-non-posix'.

Feedback is welcome.

Best regards,
Antonio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]