mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Fixes a typo.
This commit is contained in:
parent
eff03aead0
commit
d0b7012376
10 changed files with 47 additions and 46 deletions
5
HISTORY
5
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
|
||||
===========
|
||||
|
|
|
|||
14
check.c
14
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;j<failed_count;++j) {
|
||||
unsigned block_state = block_state_get(failed[j].block);
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign
|
|||
/* because the parity is computed with old content, and not with the new one. */
|
||||
/* Note that this recovering is done just to make possible to recover any other BLK one, */
|
||||
/* we are not really interested in DELETED, CHG (old version) and REP (old version). */
|
||||
something_unsynched = 1;
|
||||
something_unsynced = 1;
|
||||
|
||||
if (block_state == BLOCK_STATE_CHG
|
||||
&& hash_is_zero(failed[j].block->hash)
|
||||
|
|
@ -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;j<failed_count;++j) {
|
||||
if (failed[j].is_bad)
|
||||
fprintf(stdlog, "unrecoverable:%u:%s:%s: Unrecoverable synched error at position %u\n", i, failed[j].handle->disk->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;j<failed_count;++j) {
|
||||
if (failed[j].is_bad && failed[j].is_outofdate) {
|
||||
++partial_recover_error;
|
||||
fprintf(stdlog, "unrecoverable:%u:%s:%s: Unrecoverable unsynched error at position %u\n", i, failed[j].handle->disk->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) {
|
||||
|
|
|
|||
4
elem.h
4
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
|
||||
|
|
|
|||
38
scrub.c
38
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) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
4
state.c
4
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;
|
||||
}
|
||||
|
|
|
|||
20
status.c
20
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;i<blockmax;++i) {
|
||||
int one_invalid;
|
||||
int one_valid;
|
||||
|
|
@ -167,7 +167,7 @@ int state_status(struct snapraid_state* state)
|
|||
|
||||
/* if both valid and invalid, we need to update */
|
||||
if (one_invalid && one_valid) {
|
||||
++unsynched_blocks;
|
||||
++unsynced_blocks;
|
||||
}
|
||||
|
||||
/* skip unused blocks */
|
||||
|
|
@ -183,13 +183,13 @@ int state_status(struct snapraid_state* state)
|
|||
|
||||
if (state->opt.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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue