#3 Switch to direct I/O when errors encountered

closed-out-of-date
nobody
5
2008-10-07
2008-01-10
Jesse Kornblum
No

The program runs faster when using cached I/O. When errors are encountered the operating system can return entire block of zeros. In this situation it would be nice to have a mode where the program drops into direct I/O mode, reads the area around the error, and then returns to the non-cached (faster) mode.

See also feature request #1866032.

Discussion

  • Jesse Kornblum
    Jesse Kornblum
    2008-02-08

    Logged In: YES
    user_id=448978
    Originator: YES

    Due to the difficulty of adding this feature, it has not been assigned at this time. The nature of the desired behavior would require us to significantly alter the behavior of GNU dd. At this point we do not feel comfortable doing so.

     
  • Jesse Kornblum
    Jesse Kornblum
    2008-02-15

    Logged In: YES
    user_id=448978
    Originator: YES

    It might be possible to add this feature using the fd_reopen function. If an error is detected, reopen the file with O_DIRECT and try again. This will require
    1) Checking that O_DIRECT is defined
    2) Checking that the user has requested direct-on-error mode
    3) reopen the file handle, adding O_DIRECT
    4) seek the file handle to correct offset (meaning BEFORE the error occured)
    5) retry the read

    Unanswered questions:
    Should we drop back to non-direct mode? If so, how do we tell when we're past the error?

     
  • Andrew Medico
    Andrew Medico
    2008-06-17

    Logged In: YES
    user_id=141073
    Originator: NO

    I did some simple benchmarking, and with the test drives I have available, direct vs. cached mode doesn't seem to make a difference once the block size is large enough. I think if I can get #1866032 working, then running dc3dd in direct I/O mode with a large initial block size (say 32K) should give both increased performance and minimum data loss.

     
  • Andrew Medico
    Andrew Medico
    2008-06-19

    Logged In: YES
    user_id=141073
    Originator: NO

    #1866032 is working OK in testing so far, so I think that will make this unnecessary.

     
  • Andrew Medico
    Andrew Medico
    2008-10-07

    • status: open --> open-out-of-date
     
  • Andrew Medico
    Andrew Medico
    2008-10-07

    Closing. In 6.12.1, running with the new error recovery mode enabled (conv=sync,noerror) and direct I/O (iflag=direct) achieves both high speed and minimal inaccessible data (bad sectors only).

     
  • Andrew Medico
    Andrew Medico
    2008-10-07

    • status: open-out-of-date --> closed-out-of-date