Skip to content

Commit

Permalink
Merge branch 'master' into doc_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
amadvance authored Jan 10, 2024
2 parents 9da32e6 + 85ca997 commit 452acac
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 244 deletions.
4 changes: 2 additions & 2 deletions cmdline/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -1896,7 +1896,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
if (error && !fix)
log_fatal("WARNING! There are errors!\n");
if (unrecoverable_error)
log_fatal("DANGER! There are unrecoverable errors!\n");
log_fatal("DANGER! Unrecoverable errors detected!\n");

log_tag("summary:error:%u\n", error);
if (fix)
Expand Down Expand Up @@ -1974,7 +1974,7 @@ int state_check(struct snapraid_state* state, int fix, block_off_t blockstart, b

if (blockstart > blockmax) {
/* LCOV_EXCL_START */
log_fatal("Error in the specified starting block %u. It's bigger than the parity size %u.\n", blockstart, blockmax);
log_fatal("Error in the specified starting block %u. It's larger than the parity size %u.\n", blockstart, blockmax);
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}
Expand Down
2 changes: 1 addition & 1 deletion cmdline/dry.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void state_dry(struct snapraid_state* state, block_off_t blockstart, block_off_t

if (blockstart > blockmax) {
/* LCOV_EXCL_START */
log_fatal("Error in the specified starting block %u. It's bigger than the parity size %u.\n", blockstart, blockmax);
log_fatal("Error in the specified starting block %u. It's larger than the parity size %u.\n", blockstart, blockmax);
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}
Expand Down
44 changes: 22 additions & 22 deletions cmdline/elem.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,21 +435,21 @@ void file_copy(struct snapraid_file* src_file, struct snapraid_file* dst_file)

if (src_file->size != dst_file->size) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in copy file with different size\n");
log_fatal("Internal inconsistency: Copy file with different size\n");
os_abort();
/* LCOV_EXCL_STOP */
}

if (src_file->mtime_sec != dst_file->mtime_sec) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in copy file with different mtime_sec\n");
log_fatal("Internal inconsistency: Copy file with different mtime_sec\n");
os_abort();
/* LCOV_EXCL_STOP */
}

if (src_file->mtime_nsec != dst_file->mtime_nsec) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in copy file with different mtime_nsec\n");
log_fatal("Internal inconsistency: Copy file with different mtime_nsec\n");
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down Expand Up @@ -499,7 +499,7 @@ int file_block_is_last(struct snapraid_file* file, block_off_t file_pos)

if (file_pos >= file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file block position\n");
log_fatal("Internal inconsistency: File block position over the max\n");
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down Expand Up @@ -620,13 +620,13 @@ struct snapraid_extent* extent_alloc(block_off_t parity_pos, struct snapraid_fil

if (count == 0) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when allocating empty extent for file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
log_fatal("Internal inconsistency: Allocating empty extent for file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
os_abort();
/* LCOV_EXCL_STOP */
}
if (file_pos + count > file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when allocating overflowing extent for file '%s' at position '%u:%u/%u'\n", file->sub, file_pos, count, file->blockmax);
log_fatal("Internal inconsistency: Allocating overflowing extent for file '%s' at position '%u:%u/%u'\n", file->sub, file_pos, count, file->blockmax);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down Expand Up @@ -938,7 +938,7 @@ static void extent_parity_check_foreach_unlock(void* void_arg, void* void_obj)

if (obj->count == 0) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in parity count zero for file '%s' at '%u'\n",
log_fatal("Internal inconsistency: Parity count zero for file '%s' at '%u'\n",
obj->file->sub, obj->parity_pos);
++arg->result;
return;
Expand All @@ -952,7 +952,7 @@ static void extent_parity_check_foreach_unlock(void* void_arg, void* void_obj)
/* check the order */
if (prev->parity_pos >= obj->parity_pos) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in parity order for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
log_fatal("Internal inconsistency: Parity order for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
prev->file->sub, prev->parity_pos, prev->count, obj->file->sub, obj->parity_pos, obj->count);
++arg->result;
return;
Expand All @@ -962,7 +962,7 @@ static void extent_parity_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extents don't overlap */
if (prev->parity_pos + prev->count > obj->parity_pos) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency for parity overlap for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
log_fatal("Internal inconsistency: Parity overlap for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
prev->file->sub, prev->parity_pos, prev->count, obj->file->sub, obj->parity_pos, obj->count);
++arg->result;
return;
Expand All @@ -988,7 +988,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)

if (obj->count == 0) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file count zero for file '%s' at '%u'\n",
log_fatal("Internal inconsistency: File count zero for file '%s' at '%u'\n",
obj->file->sub, obj->file_pos);
++arg->result;
return;
Expand All @@ -1004,7 +1004,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extent doesn't overflow the file */
if (prev->file_pos + prev->count > prev->file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in delete end for file '%s' at '%u:%u' overflowing size '%u'\n",
log_fatal("Internal inconsistency: Delete end for file '%s' at '%u:%u' overflowing size '%u'\n",
prev->file->sub, prev->file_pos, prev->count, prev->file->blockmax);
++arg->result;
return;
Expand All @@ -1014,7 +1014,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extent ends the file */
if (prev->file_pos + prev->count != prev->file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file end for file '%s' at '%u:%u' instead of size '%u'\n",
log_fatal("Internal inconsistency: File end for file '%s' at '%u:%u' instead of size '%u'\n",
prev->file->sub, prev->file_pos, prev->count, prev->file->blockmax);
++arg->result;
return;
Expand All @@ -1027,7 +1027,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extent doesn't overflow the file */
if (obj->file_pos + obj->count > obj->file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in delete start for file '%s' at '%u:%u' overflowing size '%u'\n",
log_fatal("Internal inconsistency: Delete start for file '%s' at '%u:%u' overflowing size '%u'\n",
obj->file->sub, obj->file_pos, obj->count, obj->file->blockmax);
++arg->result;
return;
Expand All @@ -1037,7 +1037,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extent starts the file */
if (obj->file_pos != 0) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file start for file '%s' at '%u:%u'\n",
log_fatal("Internal inconsistency: File start for file '%s' at '%u:%u'\n",
obj->file->sub, obj->file_pos, obj->count);
++arg->result;
return;
Expand All @@ -1048,7 +1048,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check the order */
if (prev->file_pos >= obj->file_pos) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file order for file '%s' at '%u:%u' and at '%u:%u'\n",
log_fatal("Internal inconsistency: File order for file '%s' at '%u:%u' and at '%u:%u'\n",
prev->file->sub, prev->file_pos, prev->count, obj->file_pos, obj->count);
++arg->result;
return;
Expand All @@ -1059,7 +1059,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extents don't overlap */
if (prev->file_pos + prev->count > obj->file_pos) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in delete sequence for file '%s' at '%u:%u' and at '%u:%u'\n",
log_fatal("Internal inconsistency: Delete sequence for file '%s' at '%u:%u' and at '%u:%u'\n",
prev->file->sub, prev->file_pos, prev->count, obj->file_pos, obj->count);
++arg->result;
return;
Expand All @@ -1069,7 +1069,7 @@ static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
/* check that the extents are sequential */
if (prev->file_pos + prev->count != obj->file_pos) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency in file sequence for file '%s' at '%u:%u' and at '%u:%u'\n",
log_fatal("Internal inconsistency: File sequence for file '%s' at '%u:%u' and at '%u:%u'\n",
prev->file->sub, prev->file_pos, prev->count, obj->file_pos, obj->count);
++arg->result;
return;
Expand Down Expand Up @@ -1267,7 +1267,7 @@ void fs_allocate(struct snapraid_disk* disk, block_off_t parity_pos, struct snap
/* ensure that we are extending the extent at the end */
if (file_pos != extent->file_pos + extent->count) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when allocating file '%s' at position '%u/%u' in the middle of extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
log_fatal("Internal inconsistency: Allocating file '%s' at position '%u/%u' in the middle of extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand All @@ -1289,7 +1289,7 @@ void fs_allocate(struct snapraid_disk* disk, block_off_t parity_pos, struct snap

if (parity_extent != extent || file_extent != extent) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when allocating file '%s' at position '%u/%u' for existing extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
log_fatal("Internal inconsistency: Allocating file '%s' at position '%u/%u' for existing extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand All @@ -1313,7 +1313,7 @@ void fs_deallocate(struct snapraid_disk* disk, block_off_t parity_pos)
extent = fs_par2extent_get_unlock(disk, &disk->fs_last, parity_pos);
if (!extent) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when deallocating parity position '%u' for not existing extent in disk '%s'\n", parity_pos, disk->name);
log_fatal("Internal inconsistency: Deallocating parity position '%u' for not existing extent in disk '%s'\n", parity_pos, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down Expand Up @@ -1368,7 +1368,7 @@ void fs_deallocate(struct snapraid_disk* disk, block_off_t parity_pos)

if (parity_extent != second_extent || file_extent != second_extent) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when deallocating parity position '%u' for splitting extent '%u:%u' in disk '%s'\n", parity_pos, second_extent->file_pos, second_extent->count, disk->name);
log_fatal("Internal inconsistency: Deallocating parity position '%u' for splitting extent '%u:%u' in disk '%s'\n", parity_pos, second_extent->file_pos, second_extent->count, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand All @@ -1383,7 +1383,7 @@ struct snapraid_block* fs_file2block_get(struct snapraid_file* file, block_off_t
{
if (file_pos >= file->blockmax) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when dereferencing file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
log_fatal("Internal inconsistency: Dereferencing file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down
6 changes: 3 additions & 3 deletions cmdline/elem.h
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ static inline struct snapraid_file* fs_par2file_get(struct snapraid_disk* disk,
ret = fs_par2file_find(disk, parity_pos, file_pos);
if (ret == 0) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when deresolving parity to file at position '%u' in disk '%s'\n", parity_pos, disk->name);
log_fatal("Internal inconsistency: Deresolving parity to file at position '%u' in disk '%s'\n", parity_pos, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand All @@ -1072,7 +1072,7 @@ static inline block_off_t fs_file2par_get(struct snapraid_disk* disk, struct sna
ret = fs_file2par_find(disk, file, file_pos);
if (ret == POS_NULL) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when resolving file '%s' at position '%u/%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, disk->name);
log_fatal("Internal inconsistency: Resolving file '%s' at position '%u/%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand All @@ -1096,7 +1096,7 @@ static inline struct snapraid_block* fs_par2block_get(struct snapraid_disk* disk
ret = fs_par2block_find(disk, parity_pos);
if (ret == BLOCK_NULL) {
/* LCOV_EXCL_START */
log_fatal("Internal inconsistency when deresolving parity to block at position '%u' in disk '%s'\n", parity_pos, disk->name);
log_fatal("Internal inconsistency: Deresolving parity to block at position '%u' in disk '%s'\n", parity_pos, disk->name);
os_abort();
/* LCOV_EXCL_STOP */
}
Expand Down
4 changes: 2 additions & 2 deletions cmdline/parity.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ void parity_overflow(struct snapraid_state* state, data_off_t size)
}

if (found) {
log_fatal("\nYour data requires more parity than the available space.\n");
log_fatal("Please move the files 'outofparity' to another data disk.\n");
log_fatal("\nInsufficient parity space. Data requires more parity than available.\n");
log_fatal("Move the 'outofparity' files to a larger disk.\n");
}
}

Expand Down
14 changes: 7 additions & 7 deletions cmdline/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
/* if verbose, print the list of duplicates real offsets */
/* other cases are for offsets not supported, so we don't need to report them file by file */
if (phy_last >= FILEPHY_REAL_OFFSET) {
log_fatal("WARNING! Files '%s%s' and '%s%s' have the same physical offset %" PRId64 ".\n", disk->dir, phy_file_last->sub, disk->dir, file->sub, phy_last);
log_fatal("WARNING! Files '%s%s' and '%s%s' share the same physical offset %" PRId64 ".\n", disk->dir, phy_file_last->sub, disk->dir, file->sub, phy_last);
}
++phy_dup;
}
Expand Down Expand Up @@ -1859,13 +1859,13 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
}
}
if (done) {
log_fatal("\nare now missing or rewritten!\n");
log_fatal("\nare now missing or have been rewritten!\n");
if (all_rewritten) {
log_fatal("This could happen when restoring a disk with a backup\n");
log_fatal("This could occur when restoring a disk from a backup\n");
log_fatal("program that is not setting correctly the timestamps.\n");
}
if (all_missing) {
log_fatal("This could happen when some disks are not mounted\n");
log_fatal("This could occur when some disks are not mounted\n");
log_fatal("in the expected directory.\n");
}
if (!is_diff) {
Expand All @@ -1891,7 +1891,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
}
}
if (done) {
log_fatal(". Files order won't be optimal.\n");
log_fatal(". The order of files won't be optimal.\n");
}
}

Expand All @@ -1910,7 +1910,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
}
}
if (done) {
log_fatal(". Not using inodes to detect move operations.\n");
log_fatal(". Inodes are not used to detect move operations.\n");
}

/* check for disks with changed UUID */
Expand All @@ -1932,7 +1932,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff)
}
}
if (done) {
log_fatal(". Not using inodes to detect move operations.\n");
log_fatal(". Inodes are not used to detect move operations.\n");
}

/* check for disks with unsupported UUID */
Expand Down
Loading

0 comments on commit 452acac

Please sign in to comment.