Skip to content

Commit

Permalink
Do not abort if we got an unknown error
Browse files Browse the repository at this point in the history
Try to continue for a while and bail out only after a large number of
such errors.
  • Loading branch information
baruch committed Nov 26, 2015
1 parent 8e3f803 commit 61ac904
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/diskscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,18 +510,14 @@ static bool disk_scan_part(disk_t *disk, uint64_t offset, void *data, int data_s
ERROR("Fatal error occurred, bailing out.");
return false;
}
if (io_res.error == ERROR_UNKNOWN) {
if (io_res.error == ERROR_UNKNOWN || (s_errno != EIO && s_errno != 0)) {
if (state->num_unknown_errors++ > 500) {
ERROR("%u unknown errors occurred, assuming fatal issue.", state->num_unknown_errors);
return false;
}
ERROR("Unknown error occurred, possibly untranslated error by storage layers, trying to continue.");

}

if (s_errno != EIO && s_errno != 0)
abort();
// TODO: What to do when no everything was read but errno is zero?
}
else {
state->num_unknown_errors = 0; // Clear non-consecutive unknown errors
Expand Down

0 comments on commit 61ac904

Please sign in to comment.