HDF5: VFD handler reports error even if in fail-fast mode
This commit is contained in:
@@ -88,11 +88,12 @@ static void H5FD_poison_sec2_store_last_error(
|
||||
] = '\0';
|
||||
}
|
||||
|
||||
static herr_t H5FD_poison_sec2_fail_fast(H5FD_poison_sec2_t *file) {
|
||||
static herr_t H5FD_poison_sec2_fail_fast(H5FD_poison_sec2_t *file, const char *operation) {
|
||||
if (!file->poisoned)
|
||||
return 0;
|
||||
|
||||
errno = file->poison_errno != 0 ? file->poison_errno : EIO;
|
||||
H5FD_poison_sec2_store_last_error(file, operation, errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -112,6 +113,8 @@ static herr_t H5FD_poison_sec2_mark_poisoned(
|
||||
H5FD_poison_sec2_cb_ud_g
|
||||
);
|
||||
}
|
||||
} else if (errno != 0) {
|
||||
file->poison_errno = errno;
|
||||
}
|
||||
|
||||
H5FD_poison_sec2_store_last_error(file, operation, file->poison_errno);
|
||||
@@ -306,7 +309,7 @@ static herr_t H5FD_poison_sec2_read(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "read") < 0)
|
||||
return -1;
|
||||
|
||||
return H5FDread(file->inner, type, dxpl_id, addr, size, buf);
|
||||
@@ -325,7 +328,7 @@ static herr_t H5FD_poison_sec2_write(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "write") < 0)
|
||||
return H5FD_poison_sec2_write_failure_result();
|
||||
|
||||
if (H5FDwrite(file->inner, type, dxpl_id, addr, size, buf) < 0) {
|
||||
@@ -350,7 +353,7 @@ static herr_t H5FD_poison_sec2_read_vector(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "read_vector") < 0)
|
||||
return -1;
|
||||
|
||||
return H5FDread_vector(
|
||||
@@ -378,7 +381,7 @@ static herr_t H5FD_poison_sec2_write_vector(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "write_vector") < 0)
|
||||
return H5FD_poison_sec2_write_failure_result();
|
||||
|
||||
if (H5FDwrite_vector(
|
||||
@@ -413,7 +416,7 @@ static herr_t H5FD_poison_sec2_read_selection(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "read_selection") < 0)
|
||||
return -1;
|
||||
|
||||
return H5FDread_selection(
|
||||
@@ -445,7 +448,7 @@ static herr_t H5FD_poison_sec2_write_selection(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "write_selection") < 0)
|
||||
return H5FD_poison_sec2_write_failure_result();
|
||||
|
||||
if (H5FDwrite_selection(
|
||||
@@ -476,7 +479,7 @@ static herr_t H5FD_poison_sec2_flush(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "flush") < 0)
|
||||
return H5FD_poison_sec2_write_failure_result();
|
||||
|
||||
if (H5FDflush(file->inner, dxpl_id, closing) < 0) {
|
||||
@@ -497,7 +500,7 @@ static herr_t H5FD_poison_sec2_truncate(
|
||||
if (file->inner == NULL)
|
||||
return -1;
|
||||
|
||||
if (H5FD_poison_sec2_fail_fast(file) < 0)
|
||||
if (H5FD_poison_sec2_fail_fast(file, "truncate") < 0)
|
||||
return H5FD_poison_sec2_write_failure_result();
|
||||
|
||||
if (H5FDtruncate(file->inner, dxpl_id, closing) < 0) {
|
||||
|
||||
Reference in New Issue
Block a user