mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Differentiate messages in the log files if they are caused by an hardware issue
This commit is contained in:
parent
85f3f0217c
commit
d3f7bf64c1
33 changed files with 934 additions and 886 deletions
142
cmdline/sync.c
142
cmdline/sync.c
|
|
@ -39,28 +39,28 @@ static const char* es(int err)
|
|||
static void log_fatal_errno(int err, const char* name)
|
||||
{
|
||||
if (err == EIO) {
|
||||
log_fatal("DANGER! Unexpected input/output error in disk %s. It isn't possible to continue.\n", name);
|
||||
log_fatal(err, "DANGER! Unexpected input/output error in disk %s. It isn't possible to continue.\n", name);
|
||||
} else if (err == EACCES) {
|
||||
log_fatal("WARNING! Grant permission in the disk %s. It isn't possible to continue.\n", name);
|
||||
log_fatal(err, "WARNING! Grant permission in the disk %s. It isn't possible to continue.\n", name);
|
||||
} else if (err == ENOSPC) {
|
||||
log_fatal("WARNING! Ensure there is free space on the disk %s. It isn't possible to continue.\n", name);
|
||||
log_fatal(err, "WARNING! Ensure there is free space on the disk %s. It isn't possible to continue.\n", name);
|
||||
} else {
|
||||
log_fatal("WARNING! Without a working %s disk, it isn't possible to continue.\n", name);
|
||||
log_fatal(err, "WARNING! Without a working %s disk, it isn't possible to continue.\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
static void log_error_errno(int err, const char* name)
|
||||
{
|
||||
if (err == EIO) {
|
||||
log_fatal("DANGER! Unexpected input/output error in disk %s.\n", name);
|
||||
log_fatal(err, "DANGER! Unexpected input/output error in disk %s.\n", name);
|
||||
} else if (err == EACCES) {
|
||||
log_error("WARNING! Grant permission in the disk %s.\n", name);
|
||||
log_error("Rerun the sync command when finished.\n");
|
||||
log_error(err, "WARNING! Grant permission in the disk %s.\n", name);
|
||||
log_error(err, "Rerun the sync command when finished.\n");
|
||||
} else if (err == ENOSPC) {
|
||||
log_error("WARNING! Ensure there is free space on the disk %s.\n", name);
|
||||
log_error(err, "WARNING! Ensure there is free space on the disk %s.\n", name);
|
||||
} else if (err == ENOENT) {
|
||||
log_error("WARNING! You cannot modify files during a sync.\n");
|
||||
log_error("Rerun the sync command when finished.\n");
|
||||
log_error(err, "WARNING! You cannot modify files during a sync.\n");
|
||||
log_error(err, "Rerun the sync command when finished.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
/* and closing a descriptor should never fail */
|
||||
log_tag("%s:%u:%s:%s: Close error. %s.\n", es(errno), i, disk->name, esc_tag(report->sub, esc_buffer), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
log_fatal("Stopping at block %u\n", i);
|
||||
log_fatal(errno, "Stopping at block %u\n", i);
|
||||
|
||||
if (errno == EIO) {
|
||||
++io_error;
|
||||
|
|
@ -212,10 +212,10 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
if (errno == EIO) {
|
||||
log_fatal("Stopping at block %u\n", i);
|
||||
log_fatal(errno, "Stopping at block %u\n", i);
|
||||
++io_error;
|
||||
} else {
|
||||
log_fatal("Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, file->sub, esc_buffer));
|
||||
log_fatal(errno, "Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, file->sub, esc_buffer));
|
||||
++soft_error;
|
||||
}
|
||||
goto bail;
|
||||
|
|
@ -230,14 +230,14 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
) {
|
||||
if (handle[j].st.st_size != file->size) {
|
||||
log_tag("error:%u:%s:%s: Unexpected size change\n", i, disk->name, esc_tag(file->sub, esc_buffer));
|
||||
log_error("Unexpected size change at file '%s' from %" PRIu64 " to %" PRIu64 ".\n", handle[j].path, file->size, (uint64_t)handle[j].st.st_size);
|
||||
log_error(ESOFT, "Unexpected size change at file '%s' from %" PRIu64 " to %" PRIu64 ".\n", handle[j].path, file->size, (uint64_t)handle[j].st.st_size);
|
||||
} else if (handle[j].st.st_mtime != file->mtime_sec
|
||||
|| STAT_NSEC(&handle[j].st) != file->mtime_nsec) {
|
||||
log_tag("error:%u:%s:%s: Unexpected time change\n", i, disk->name, esc_tag(file->sub, esc_buffer));
|
||||
log_error("Unexpected time change at file '%s' from %" PRIu64 ".%d to %" PRIu64 ".%d.\n", handle[j].path, file->mtime_sec, file->mtime_nsec, (uint64_t)handle[j].st.st_mtime, STAT_NSEC(&handle[j].st));
|
||||
log_error(ESOFT, "Unexpected time change at file '%s' from %" PRIu64 ".%d to %" PRIu64 ".%d.\n", handle[j].path, file->mtime_sec, file->mtime_nsec, (uint64_t)handle[j].st.st_mtime, STAT_NSEC(&handle[j].st));
|
||||
} else {
|
||||
log_tag("error:%u:%s:%s: Unexpected inode change\n", i, disk->name, esc_tag(file->sub, esc_buffer));
|
||||
log_error("Unexpected inode change from %" PRIu64 " to %" PRIu64 " at file '%s'.\n", file->inode, (uint64_t)handle[j].st.st_ino, handle[j].path);
|
||||
log_error(ESOFT, "Unexpected inode change from %" PRIu64 " to %" PRIu64 " at file '%s'.\n", file->inode, (uint64_t)handle[j].st.st_ino, handle[j].path);
|
||||
}
|
||||
log_error_errno(ENOENT, disk->name); /* same message for ENOENT */
|
||||
|
||||
|
|
@ -255,10 +255,10 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
if (errno == EIO) {
|
||||
log_fatal("Stopping at block %u\n", i);
|
||||
log_fatal(errno, "Stopping at block %u\n", i);
|
||||
++io_error;
|
||||
} else {
|
||||
log_fatal("Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, file->sub, esc_buffer));
|
||||
log_fatal(errno, "Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, file->sub, esc_buffer));
|
||||
++soft_error;
|
||||
}
|
||||
goto bail;
|
||||
|
|
@ -286,16 +286,16 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
/* compare the hash */
|
||||
if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
|
||||
log_tag("error_data:%u:%s:%s: Unexpected data change\n", i, disk->name, esc_tag(file->sub, esc_buffer));
|
||||
log_error("Data change at file '%s' at position '%u'\n", handle[j].path, file_pos);
|
||||
log_error("WARNING! Unexpected data modification of a file without parity!\n");
|
||||
log_error(EDATA, "Data change at file '%s' at position '%u'\n", handle[j].path, file_pos);
|
||||
log_error(EDATA, "WARNING! Unexpected data modification of a file without parity!\n");
|
||||
|
||||
if (file_flag_has(file, FILE_IS_COPY)) {
|
||||
log_error("This file was detected as a copy of another file with the same name, size,\n");
|
||||
log_error("and timestamp, but the file data isn't matching the assumed copy.\n");
|
||||
log_error("If this is a false positive, and the files are expected to be different,\n");
|
||||
log_error("you can 'sync' anyway using 'snapraid --force-nocopy sync'\n");
|
||||
log_error(EDATA, "This file was detected as a copy of another file with the same name, size,\n");
|
||||
log_error(EDATA, "and timestamp, but the file data isn't matching the assumed copy.\n");
|
||||
log_error(EDATA, "If this is a false positive, and the files are expected to be different,\n");
|
||||
log_error(EDATA, "you can 'sync' anyway using 'snapraid --force-nocopy sync'\n");
|
||||
} else {
|
||||
log_error("Try removing the file from the array and rerun the 'sync' command!\n");
|
||||
log_error(EDATA, "Try removing the file from the array and rerun the 'sync' command!\n");
|
||||
}
|
||||
|
||||
/* block sync to allow a recovery before overwriting */
|
||||
|
|
@ -342,7 +342,7 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
|||
/* and closing a descriptor should never fail */
|
||||
log_tag("%s:%u:%s:%s: Close error. %s.\n", es(errno), blockmax, disk->name, esc_tag(report->sub, esc_buffer), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
log_fatal("Stopping at block %u\n", blockmax);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockmax);
|
||||
|
||||
if (errno == EIO) {
|
||||
++io_error;
|
||||
|
|
@ -374,7 +374,7 @@ end:
|
|||
}
|
||||
|
||||
if (soft_error)
|
||||
log_fatal("WARNING! Unexpected soft errors!\n");
|
||||
log_fatal(ESOFT, "WARNING! Unexpected soft errors!\n");
|
||||
|
||||
log_tag("hash_summary:error_soft:%u\n", soft_error);
|
||||
|
||||
|
|
@ -540,7 +540,7 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
/* and closing a descriptor should never fail */
|
||||
log_tag("%s:%u:%s:%s: Close error. %s.\n", es(errno), blockcur, disk->name, esc_tag(report->sub, esc_buffer), strerror(errno));
|
||||
log_fatal_errno(errno, disk->name);
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
|
||||
if (errno == EIO) {
|
||||
task->state = TASK_STATE_IOERROR;
|
||||
|
|
@ -576,10 +576,10 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
log_fatal_errno(errno, disk->name);
|
||||
|
||||
if (errno == EIO) {
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
task->state = TASK_STATE_IOERROR;
|
||||
} else {
|
||||
log_fatal("Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, task->file->sub, esc_buffer));
|
||||
log_fatal(errno, "Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, task->file->sub, esc_buffer));
|
||||
task->state = TASK_STATE_ERROR;
|
||||
}
|
||||
return;
|
||||
|
|
@ -594,12 +594,12 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
) {
|
||||
log_tag("error:%u:%s:%s: Unexpected attribute change\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer));
|
||||
if (handle->st.st_size != task->file->size) {
|
||||
log_error("Unexpected size change at file '%s' from %" PRIu64 " to %" PRIu64 ".\n", handle->path, task->file->size, (uint64_t)handle->st.st_size);
|
||||
log_error(ESOFT, "Unexpected size change at file '%s' from %" PRIu64 " to %" PRIu64 ".\n", handle->path, task->file->size, (uint64_t)handle->st.st_size);
|
||||
} else if (handle->st.st_mtime != task->file->mtime_sec
|
||||
|| STAT_NSEC(&handle->st) != task->file->mtime_nsec) {
|
||||
log_error("Unexpected time change at file '%s' from %" PRIu64 ".%d to %" PRIu64 ".%d.\n", handle->path, task->file->mtime_sec, task->file->mtime_nsec, (uint64_t)handle->st.st_mtime, STAT_NSEC(&handle->st));
|
||||
log_error(ESOFT, "Unexpected time change at file '%s' from %" PRIu64 ".%d to %" PRIu64 ".%d.\n", handle->path, task->file->mtime_sec, task->file->mtime_nsec, (uint64_t)handle->st.st_mtime, STAT_NSEC(&handle->st));
|
||||
} else {
|
||||
log_error("Unexpected inode change from %" PRIu64 " to %" PRIu64 " at file '%s'.\n", task->file->inode, (uint64_t)handle->st.st_ino, handle->path);
|
||||
log_error(ESOFT, "Unexpected inode change from %" PRIu64 " to %" PRIu64 " at file '%s'.\n", task->file->inode, (uint64_t)handle->st.st_ino, handle->path);
|
||||
}
|
||||
log_error_errno(ENOENT, disk->name); /* same message for ENOENT */
|
||||
|
||||
|
|
@ -620,7 +620,7 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
task->state = TASK_STATE_IOERROR_CONTINUE;
|
||||
} else {
|
||||
log_fatal_errno(errno, disk->name);
|
||||
log_fatal("Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, task->file->sub, esc_buffer));
|
||||
log_fatal(errno, "Stopping to allow recovery. Try with 'snapraid check -f /%s'\n", fmt_poll(disk, task->file->sub, esc_buffer));
|
||||
task->state = TASK_STATE_ERROR;
|
||||
}
|
||||
return;
|
||||
|
|
@ -655,7 +655,7 @@ static void sync_parity_writer(struct snapraid_worker* worker, struct snapraid_t
|
|||
task->state = TASK_STATE_IOERROR_CONTINUE;
|
||||
} else {
|
||||
log_fatal_errno(errno, lev_config_name(level));
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
task->state = TASK_STATE_ERROR;
|
||||
}
|
||||
return;
|
||||
|
|
@ -919,8 +919,8 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
++io_error;
|
||||
if (io_error >= state->opt.io_error_limit) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("DANGER! Too many input/output errors in the %s disk. It isn't possible to continue.\n", disk->dir);
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(EIO, "DANGER! Too many input/output errors in the %s disk. It isn't possible to continue.\n", disk->dir);
|
||||
log_fatal(EIO, "Stopping at block %u\n", blockcur);
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -931,7 +931,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
}
|
||||
if (task->state != TASK_STATE_DONE) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Internal inconsistency in task state\n");
|
||||
log_fatal(EINTERNAL, "Internal inconsistency in task state\n");
|
||||
os_abort();
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -958,16 +958,16 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
/* if the file has invalid parity, it's a REP changed during the sync */
|
||||
if (block_has_invalid_parity(block)) {
|
||||
log_tag("error:%u:%s:%s: Unexpected data change\n", blockcur, disk->name, esc_tag(file->sub, esc_buffer));
|
||||
log_error("Data change at file '%s' at position '%u'\n", task->path, file_pos);
|
||||
log_error("WARNING! Unexpected data modification of a file without parity!\n");
|
||||
log_error(ESOFT, "Data change at file '%s' at position '%u'\n", task->path, file_pos);
|
||||
log_error(ESOFT, "WARNING! Unexpected data modification of a file without parity!\n");
|
||||
|
||||
if (file_flag_has(file, FILE_IS_COPY)) {
|
||||
log_error("This file was detected as a copy of another file with the same name, size,\n");
|
||||
log_error("and timestamp, but the file data isn't matching the assumed copy.\n");
|
||||
log_error("If this is a false positive, and the files are expected to be different,\n");
|
||||
log_error("you can 'sync' anyway using 'snapraid --force-nocopy sync'\n");
|
||||
log_error(ESOFT, "This file was detected as a copy of another file with the same name, size,\n");
|
||||
log_error(ESOFT, "and timestamp, but the file data isn't matching the assumed copy.\n");
|
||||
log_error(ESOFT, "If this is a false positive, and the files are expected to be different,\n");
|
||||
log_error(ESOFT, "you can 'sync' anyway using 'snapraid --force-nocopy sync'\n");
|
||||
} else {
|
||||
log_error("Try removing the file from the array and rerun the 'sync' command!\n");
|
||||
log_error(ESOFT, "Try removing the file from the array and rerun the 'sync' command!\n");
|
||||
}
|
||||
|
||||
++soft_error;
|
||||
|
|
@ -979,7 +979,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
} else { /* otherwise it's a BLK with silent error */
|
||||
unsigned diff = memdiff(hash, block->hash, BLOCK_HASH_SIZE);
|
||||
log_tag("error_data:%u:%s:%s: Data error at position %u, diff hash bits %u/%u\n", blockcur, disk->name, esc_tag(file->sub, esc_buffer), file_pos, diff, BLOCK_HASH_SIZE * 8);
|
||||
log_error("Data error in file '%s' at position '%u', diff hash bits %u/%u\n", task->path, file_pos, diff, BLOCK_HASH_SIZE * 8);
|
||||
log_error(EDATA, "Data error in file '%s' at position '%u', diff hash bits %u/%u\n", task->path, file_pos, diff, BLOCK_HASH_SIZE * 8);
|
||||
|
||||
/* save the failed block for the fix */
|
||||
failed[failed_count].index = diskcur;
|
||||
|
|
@ -1084,8 +1084,8 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
if (errno == EIO) {
|
||||
log_error_errno(errno, lev_config_name(l));
|
||||
if (io_error >= state->opt.io_error_limit) {
|
||||
log_fatal("DANGER! Too many input/output errors in the %s disk. It isn't possible to continue.\n", lev_config_name(l));
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "DANGER! Too many input/output errors in the %s disk. It isn't possible to continue.\n", lev_config_name(l));
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
++io_error;
|
||||
goto bail;
|
||||
}
|
||||
|
|
@ -1096,7 +1096,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
}
|
||||
|
||||
log_fatal_errno(errno, lev_config_name(l));
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
++soft_error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -1263,8 +1263,8 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
++io_error;
|
||||
if (io_error >= state->opt.io_error_limit) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("DANGER! Too many input/output errors in a parity disk. It isn't possible to continue.\n");
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(EIO, "DANGER! Too many input/output errors in a parity disk. It isn't possible to continue.\n");
|
||||
log_fatal(EIO, "Stopping at block %u\n", blockcur);
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -1310,7 +1310,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
ret = state_flush(state, &io, parity_handle, blockcur);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
++io_error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -1345,7 +1345,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
ret = state_flush(state, &io, parity_handle, blockcur);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(EIO, "Stopping at block %u\n", blockcur);
|
||||
++io_error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -1369,7 +1369,7 @@ end:
|
|||
ret = state_flush(state, &io, parity_handle, blockcur);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Stopping at block %u\n", blockcur);
|
||||
log_fatal(errno, "Stopping at block %u\n", blockcur);
|
||||
++io_error;
|
||||
goto bail;
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -1380,7 +1380,7 @@ end:
|
|||
if ((state->need_write || state->opt.force_content_write))
|
||||
state_write(state);
|
||||
} else {
|
||||
log_fatal("WARNING! Skipped writing state due to --test-kill-after-sync option.\n");
|
||||
log_fatal(EUSER, "WARNING! Skipped writing state due to --test-kill-after-sync option.\n");
|
||||
}
|
||||
|
||||
state_usage_print(state);
|
||||
|
|
@ -1397,14 +1397,14 @@ end:
|
|||
}
|
||||
|
||||
if (soft_error)
|
||||
log_fatal("WARNING! Unexpected soft errors!\n");
|
||||
log_fatal(ESOFT, "WARNING! Unexpected soft errors!\n");
|
||||
if (io_error)
|
||||
log_fatal("DANGER! Unexpected input/output errors! The failing blocks are now marked as bad!\n");
|
||||
log_fatal(EIO, "DANGER! Unexpected input/output errors! The failing blocks are now marked as bad!\n");
|
||||
if (silent_error)
|
||||
log_fatal("DANGER! Unexpected silent data errors! The failing blocks are now marked as bad!\n");
|
||||
log_fatal(EDATA, "DANGER! Unexpected silent data errors! The failing blocks are now marked as bad!\n");
|
||||
if (io_error || silent_error) {
|
||||
log_fatal("Use 'snapraid status' to list the bad blocks.\n");
|
||||
log_fatal("Use 'snapraid -e fix' to recover.\n");
|
||||
log_fatal(ESOFT, "Use 'snapraid status' to list the bad blocks.\n");
|
||||
log_fatal(ESOFT, "Use 'snapraid -e fix' to recover.\n");
|
||||
}
|
||||
|
||||
log_tag("summary:error_soft:%u\n", soft_error);
|
||||
|
|
@ -1487,7 +1487,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
|
||||
if (blockstart > blockmax) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Error in the starting block %u. It is larger than the parity size %u.\n", blockstart, blockmax);
|
||||
log_fatal(EUSER, "Error in the starting block %u. It is larger than the parity size %u.\n", blockstart, blockmax);
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -1517,7 +1517,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
|
||||
/* if the file is too small */
|
||||
if (parityblocks < used_paritymax) {
|
||||
log_fatal("WARNING! The %s parity has only %u blocks instead of %u.\n", lev_name(l), parityblocks, used_paritymax);
|
||||
log_fatal(ESOFT, "WARNING! The %s parity has only %u blocks instead of %u.\n", lev_name(l), parityblocks, used_paritymax);
|
||||
}
|
||||
|
||||
/* keep the smallest parity number of blocks */
|
||||
|
|
@ -1530,15 +1530,15 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
/* if the parities are too small */
|
||||
if (file_paritymax < used_paritymax) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("DANGER! One or more the parity files are smaller than expected!\n");
|
||||
log_fatal(ESOFT, "DANGER! One or more the parity files are smaller than expected!\n");
|
||||
if (file_paritymax != 0) {
|
||||
log_fatal("If this happens because you are using an old content file,\n");
|
||||
log_fatal("you can 'sync' anyway using 'snapraid --force-full sync'\n");
|
||||
log_fatal("to force a full rebuild of the parity.\n");
|
||||
log_fatal(ESOFT, "If this happens because you are using an old content file,\n");
|
||||
log_fatal(ESOFT, "you can 'sync' anyway using 'snapraid --force-full sync'\n");
|
||||
log_fatal(ESOFT, "to force a full rebuild of the parity.\n");
|
||||
} else {
|
||||
log_fatal("It's possible that the parity disks are not mounted.\n");
|
||||
log_fatal("If instead you are adding a new parity level, you can 'sync' using\n");
|
||||
log_fatal("'snapraid --force-full sync' to force a full rebuild of the parity.\n");
|
||||
log_fatal(ESOFT, "It's possible that the parity disks are not mounted.\n");
|
||||
log_fatal(ESOFT, "If instead you are adding a new parity level, you can 'sync' using\n");
|
||||
log_fatal(ESOFT, "'snapraid --force-full sync' to force a full rebuild of the parity.\n");
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
|
@ -1575,7 +1575,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
data_off_t out_size;
|
||||
parity_size(&parity_handle[l], &out_size);
|
||||
parity_overflow(state, out_size);
|
||||
log_fatal("WARNING! Without a usable %s file, it isn't possible to sync.\n", lev_name(l));
|
||||
log_fatal(errno, "WARNING! Without a usable %s file, it isn't possible to sync.\n", lev_name(l));
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -1611,7 +1611,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
if (state->need_write)
|
||||
state_write(state);
|
||||
} else {
|
||||
log_fatal("WARNING! Skipped state write for --test-skip-content-write option.\n");
|
||||
log_fatal(EUSER, "WARNING! Skipped state write for --test-skip-content-write option.\n");
|
||||
}
|
||||
|
||||
/* skip degenerated cases of empty parity, or skipping all */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue