mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 03:47:05 -05:00
Document handle_close failures
This commit is contained in:
parent
1b2f619852
commit
ebe2bbe76c
4 changed files with 21 additions and 0 deletions
|
|
@ -2004,6 +2004,10 @@ bail:
|
||||||
ret = handle_close(&handle[j]);
|
ret = handle_close(&handle[j]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
/*
|
||||||
|
* If handle_close fails, the handle was open (f != -1), which
|
||||||
|
* guarantees that both file and disk pointers are valid.
|
||||||
|
*/
|
||||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockmax, disk->name, esc_tag(file->sub), strerror(errno));
|
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockmax, disk->name, esc_tag(file->sub), strerror(errno));
|
||||||
log_fatal_errno(errno, disk->name);
|
log_fatal_errno(errno, disk->name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ static void dry_data_reader(struct snapraid_worker* worker, struct snapraid_task
|
||||||
ret = handle_close(handle);
|
ret = handle_close(handle);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This one is really an unexpected error, because we are only reading
|
* This one is really an unexpected error, because we are only reading
|
||||||
* and closing a descriptor should never fail
|
* and closing a descriptor should never fail
|
||||||
|
|
@ -368,6 +369,10 @@ bail:
|
||||||
ret = handle_close(&handle[j]);
|
ret = handle_close(&handle[j]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
/*
|
||||||
|
* If handle_close fails, the handle was open (f != -1), which
|
||||||
|
* guarantees that both file and disk pointers are valid.
|
||||||
|
*/
|
||||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||||
log_fatal_errno(errno, disk->name);
|
log_fatal_errno(errno, disk->name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,10 @@ bail:
|
||||||
ret = handle_close(&handle[j]);
|
ret = handle_close(&handle[j]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
/*
|
||||||
|
* If handle_close fails, the handle was open (f != -1), which
|
||||||
|
* guarantees that both file and disk pointers are valid.
|
||||||
|
*/
|
||||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||||
log_fatal_errno(errno, disk->name);
|
log_fatal_errno(errno, disk->name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,10 @@ bail:
|
||||||
ret = handle_close(&handle[j]);
|
ret = handle_close(&handle[j]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
/*
|
||||||
|
* If handle_close fails, the handle was open (f != -1), which
|
||||||
|
* guarantees that both file and disk pointers are valid.
|
||||||
|
*/
|
||||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||||
log_fatal_errno(errno, disk->name);
|
log_fatal_errno(errno, disk->name);
|
||||||
|
|
||||||
|
|
@ -1485,6 +1489,10 @@ bail:
|
||||||
ret = handle_close(&handle[j]);
|
ret = handle_close(&handle[j]);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
/* LCOV_EXCL_START */
|
/* LCOV_EXCL_START */
|
||||||
|
/*
|
||||||
|
* If handle_close fails, the handle was open (f != -1), which
|
||||||
|
* guarantees that both file and disk pointers are valid.
|
||||||
|
*/
|
||||||
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
log_tag("%s:%" PRIu64 ":%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(file->sub), strerror(errno));
|
||||||
log_fatal_errno(errno, disk->name);
|
log_fatal_errno(errno, disk->name);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue