From d0b7012376b9429c2a0398836aa9d35ba27ca103 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 4 Mar 2014 19:34:55 +0100 Subject: [PATCH] Fixes a typo. --- HISTORY | 5 +++-- check.c | 14 +++++++------- elem.h | 4 ++-- scrub.c | 38 +++++++++++++++++++------------------- snapraid.1 | 2 +- snapraid.c | 2 +- snapraid.d | 2 +- snapraid.txt | 2 +- state.c | 4 ++-- status.c | 20 ++++++++++---------- 10 files changed, 47 insertions(+), 46 deletions(-) diff --git a/HISTORY b/HISTORY index ffadab20..9fa4c98c 100644 --- a/HISTORY +++ b/HISTORY @@ -28,11 +28,12 @@ SnapRAID HISTORY * New source code organization. The RAID engine is now an external component usable also in other projects. -5.3 2014/2 (BETA) -================= +5.3 2014/3 +========== * Don't warn about UUID changed if it's for an empty disk. * Fixed the number of blocks that scrub has to process when selecting a high percentage of the array. + * Removed duplicate recovery attempts in synced state. 5.2 2013/12 =========== diff --git a/check.c b/check.c index fa4fdb42..c7e841a8 100644 --- a/check.c +++ b/check.c @@ -283,7 +283,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign unsigned j; int n; int something_to_recover; - int something_unsynched; + int something_unsynced; error = 0; @@ -406,7 +406,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign /* and we are not interested to recover DELETED ones. */ n = 0; something_to_recover = 0; /* keep track if there is at least one block to fix */ - something_unsynched = 0; /* keep track if we have some unsynched info to process */ + something_unsynced = 0; /* keep track if we have some unsynced info to process */ for(j=0;jhash) @@ -468,8 +468,8 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign } /* if nothing to fix, we just don't try */ - /* if nothing unsynched we also don't retry, because it's the same try as before */ - if (something_to_recover && something_unsynched) { + /* if nothing unsynced we also don't retry, because it's the same try as before */ + if (something_to_recover && something_unsynced) { ret = repair_step(state, rehash, pos, diskmax, failed, failed_map, n, buffer, buffer_recov, buffer_zero); if (ret == 0) { /* we alreay marked as outdated CHG and REP blocks, we don't need to do it again */ @@ -858,7 +858,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna /* print a list of all the errors in files */ for(j=0;jdisk->name, block_file_get(failed[j].block)->sub, block_file_pos(failed[j].block)); + fprintf(stdlog, "unrecoverable:%u:%s:%s: Unrecoverable synced error at position %u\n", i, failed[j].handle->disk->name, block_file_get(failed[j].block)->sub, block_file_pos(failed[j].block)); } /* keep track of damaged files */ @@ -876,7 +876,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna for(j=0;jdisk->name, block_file_get(failed[j].block)->sub, block_file_pos(failed[j].block)); + fprintf(stdlog, "unrecoverable:%u:%s:%s: Unrecoverable unsynced error at position %u\n", i, failed[j].handle->disk->name, block_file_get(failed[j].block)->sub, block_file_pos(failed[j].block)); } } if (partial_recover_error != 0) { diff --git a/elem.h b/elem.h index 554fe587..c3a1cddd 100644 --- a/elem.h +++ b/elem.h @@ -94,7 +94,7 @@ struct snapraid_filter { * * For this reson we clear all such hashes when reading the state from an incomplete sync when * starting a new sync, because sync is affected by sych hashes. - * Check and fix are instead able to work with unsynched hashes. + * Check and fix are instead able to work with unsynced hashes. * Scrub is not affected because it ignores CHG/DELETED blocks. */ #define BLOCK_STATE_CHG 2 @@ -122,7 +122,7 @@ struct snapraid_filter { * * For this reson we clear all such hashes when reading the state from an incomplete sync when * starting a new sync, because sync is affected by sych hashes. - * Check and fix are instead able to work with unsynched hashes. + * Check and fix are instead able to work with unsynced hashes. * Scrub is not affected because it ignores CHG/DELETED blocks. */ #define BLOCK_STATE_DELETED 4 diff --git a/scrub.c b/scrub.c index defbf16a..d80e52ea 100644 --- a/scrub.c +++ b/scrub.c @@ -133,7 +133,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par snapraid_info info; int error_on_this_block; int silent_error_on_this_block; - int block_is_unsynched; + int block_is_unsynced; int ret; int rehash; @@ -181,9 +181,9 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par error_on_this_block = 0; silent_error_on_this_block = 0; - /* if all the blocks at this address are synched */ + /* if all the blocks at this address are synced */ /* if not, parity is not even checked */ - block_is_unsynched = 0; + block_is_unsynced = 0; /* if we have to use the old hash */ rehash = info_get_rehash(info); @@ -193,11 +193,11 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par int read_size; unsigned char hash[HASH_SIZE]; struct snapraid_block* block; - int file_is_unsynched; + int file_is_unsynced; - /* if the file on this disk is synched */ + /* if the file on this disk is synced */ /* if not, silent errors are assumed as expected error */ - file_is_unsynched = 0; + file_is_unsynced = 0; /* by default no rehash in case of "continue" */ rehandle[j].block = 0; @@ -217,11 +217,11 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par continue; } - /* if the block is unsynched, errors are expected */ + /* if the block is unsynced, errors are expected */ if (block_has_invalid_parity(block)) { - /* report that the block and the file are not synched */ - block_is_unsynched = 1; - file_is_unsynched = 1; + /* report that the block and the file are not synced */ + block_is_unsynced = 1; + file_is_unsynced = 1; /* follow */ } @@ -260,16 +260,16 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par || STAT_NSEC(&handle[j].st) != block_file_get(block)->mtime_nsec || handle[j].st.st_ino != block_file_get(block)->inode ) { - /* report that the block and the file are not synched */ - block_is_unsynched = 1; - file_is_unsynched = 1; + /* report that the block and the file are not synced */ + block_is_unsynced = 1; + file_is_unsynced = 1; /* follow */ } /* note that we intentionally don't abort if the file has different attributes */ /* from the last sync, as we are expected to return errors if running */ - /* in an unsynched array. This is just like the check command. */ + /* in an unsynced array. This is just like the check command. */ read_size = handle_read(&handle[j], block, buffer[j], state->block_size, stderr); if (read_size == -1) { @@ -297,8 +297,8 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par if (memcmp(hash, block->hash, HASH_SIZE) != 0) { fprintf(stdlog, "error:%u:%s:%s: Data error at position %u\n", i, handle[j].disk->name, handle[j].file->sub, block_file_pos(block)); - /* it's a silent error only if we are dealing with synched files */ - if (file_is_unsynched) { + /* it's a silent error only if we are dealing with synced files */ + if (file_is_unsynced) { ++error; error_on_this_block = 1; } else { @@ -345,8 +345,8 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par if (buffer_recov[l] && memcmp(buffer[diskmax + l], buffer_recov[l], state->block_size) != 0) { fprintf(stdlog, "parity_error:%u:%s: Data error\n", i, lev_config_name(l)); - /* it's a silent error only if we are dealing with synched blocks */ - if (block_is_unsynched) { + /* it's a silent error only if we are dealing with synced blocks */ + if (block_is_unsynced) { ++error; error_on_this_block = 1; } else { @@ -366,7 +366,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par info_set(&state->infoarr, i, info_set_bad(info)); } else if (error_on_this_block) { /* do nothing, as this is a generic error */ - /* likely caused by a not synched array */ + /* likely caused by a not synced array */ } else { /* if rehash is needed */ if (rehash) { diff --git a/snapraid.1 b/snapraid.1 index 87acd4f4..2aef398d 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -567,7 +567,7 @@ The oldest blocks are scrubbed first ensuring an optimal check. Blocks already marked as bad are always checked, and if found correct, they are automatically unmarked. .PP -It\(cqs recommended to run \(a"scrub\(a" on a synched array, to avoid to have +It\(cqs recommended to run \(a"scrub\(a" on a synced array, to avoid to have reported error caused by unsynced data. These errors are recognized as not being silent errors, and the blocks are not marked as bad, but such errors are reported in the output of the command. diff --git a/snapraid.c b/snapraid.c index 3b8d13ed..50a0988f 100644 --- a/snapraid.c +++ b/snapraid.c @@ -760,7 +760,7 @@ int main(int argc, char* argv[]) /* - add some files at the array */ /* - run a sync command, it will recompute the parity adding the new files */ /* - abort the sync command before it stores the new content file */ - /* - delete the not yet synched files from the array */ + /* - delete the not yet synced files from the array */ /* - run a new sync command */ /* the new sync command has now way to know that the parity file was modified */ diff --git a/snapraid.d b/snapraid.d index 2b69593f..ae36338a 100644 --- a/snapraid.d +++ b/snapraid.d @@ -325,7 +325,7 @@ Commands Blocks already marked as bad are always checked, and if found correct, they are automatically unmarked. - It's recommended to run "scrub" on a synched array, to avoid to have + It's recommended to run "scrub" on a synced array, to avoid to have reported error caused by unsynced data. These errors are recognized as not being silent errors, and the blocks are not marked as bad, but such errors are reported in the output of the command. diff --git a/snapraid.txt b/snapraid.txt index 5a0364c1..550bc44b 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -353,7 +353,7 @@ The oldest blocks are scrubbed first ensuring an optimal check. Blocks already marked as bad are always checked, and if found correct, they are automatically unmarked. -It's recommended to run "scrub" on a synched array, to avoid to have +It's recommended to run "scrub" on a synced array, to avoid to have reported error caused by unsynced data. These errors are recognized as not being silent errors, and the blocks are not marked as bad, but such errors are reported in the output of the command. diff --git a/state.c b/state.c index 99d2a493..3309b8e5 100644 --- a/state.c +++ b/state.c @@ -1113,7 +1113,7 @@ static int position_is_required(struct snapraid_state* state, block_off_t pos) * and the we add it when importing old context files. * * Note that you can have position without info blocks, for example - * if all the blocks are not synched. + * if all the blocks are not synced. * * Note also that not requiring an info block, doesn't mean that if present it * can be discarded. @@ -1127,7 +1127,7 @@ static int info_is_required(struct snapraid_state* state, block_off_t pos) struct snapraid_disk* disk = i->data; struct snapraid_block* block = disk_block_get(disk, pos); - /* if we have at least one synched file, the info is required */ + /* if we have at least one synced file, the info is required */ if (block_state_get(block) == BLOCK_STATE_BLK) return 1; } diff --git a/status.c b/status.c index 06ec1f71..647d5c44 100644 --- a/status.c +++ b/status.c @@ -55,7 +55,7 @@ int state_status(struct snapraid_state* state) unsigned file_fragmented; unsigned extra_fragment; uint64_t file_size; - unsigned unsynched_blocks; + unsigned unsynced_blocks; /* get the present time */ now = time(0); @@ -140,12 +140,12 @@ int state_status(struct snapraid_state* state) fprintf(stdlog, "summary:block_count:%u\n", blockmax); fflush(stdlog); - /* copy the info a temp vector, and count bad/rehash/unsynched blocks */ + /* copy the info a temp vector, and count bad/rehash/unsynced blocks */ infomap = malloc_nofail(blockmax * sizeof(snapraid_info)); bad = 0; count = 0; rehash = 0; - unsynched_blocks = 0; + unsynced_blocks = 0; for(i=0;iopt.gui) { if (info != 0) - fprintf(stdlog, "block:%u:%"PRIu64":%s:%s:%s:%s\n", i, (uint64_t)info_get_time(info), one_valid ? "used": "", one_invalid ? "unsynched" : "", info_get_bad(info) ? "bad" : "", info_get_rehash(info) ? "rehash" : ""); + fprintf(stdlog, "block:%u:%"PRIu64":%s:%s:%s:%s\n", i, (uint64_t)info_get_time(info), one_valid ? "used": "", one_invalid ? "unsynced" : "", info_get_bad(info) ? "bad" : "", info_get_rehash(info) ? "rehash" : ""); else - fprintf(stdlog, "block_noinfo:%u:%s:%s\n", i, one_valid ? "used": "", one_invalid ? "unsynched" : ""); + fprintf(stdlog, "block_noinfo:%u:%s:%s\n", i, one_valid ? "used": "", one_invalid ? "unsynced" : ""); } } - fprintf(stdlog, "summary:has_unsynched:%u\n", unsynched_blocks); + fprintf(stdlog, "summary:has_unsynced:%u\n", unsynced_blocks); fprintf(stdlog, "summary:has_rehash:%u\n", rehash); fprintf(stdlog, "summary:has_bad:%u\n", bad); fprintf(stdlog, "summary:time_count:%u\n", count); @@ -285,9 +285,9 @@ int state_status(struct snapraid_state* state) printf("\n"); - if (unsynched_blocks) { - printf("WARNING! The array is NOT fully synched.\n"); - printf("You have a sync in progress at %u%%.\n", (blockmax - unsynched_blocks) * 100 / blockmax); + if (unsynced_blocks) { + printf("WARNING! The array is NOT fully synced.\n"); + printf("You have a sync in progress at %u%%.\n", (blockmax - unsynced_blocks) * 100 / blockmax); } else { printf("No sync is in progress.\n"); }