From 30fabb7d50820046c60b673782cbe4238c2722ec Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 30 Jul 2013 20:49:08 +0200 Subject: [PATCH] Fixes some comments. --- elem.h | 14 +++++++------- scan.c | 4 ++-- scrub.c | 8 ++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/elem.h b/elem.h index 877398b8..fa8e892d 100644 --- a/elem.h +++ b/elem.h @@ -710,7 +710,7 @@ static inline snapraid_info info_make(time_t last_access, int error, int rehash) } /** - * Extract the time information. + * Extracts the time information. * This is the last time when the block was know to be correct. */ static inline time_t info_get_time(snapraid_info info) @@ -719,8 +719,8 @@ static inline time_t info_get_time(snapraid_info info) } /** - * Extract the error information. - * This report if the block address is reporting to have some problem. + * Extracts the error information. + * Reports if the block address had some problem. */ static inline int info_get_bad(snapraid_info info) { @@ -728,8 +728,8 @@ static inline int info_get_bad(snapraid_info info) } /** - * Extract the error information. - * This report if the block address is reporting to have some problem. + * Extracts the rehash information. + * Reports if the block address is using the old hash and needs to be rehashed. */ static inline int info_get_rehash(snapraid_info info) { @@ -737,7 +737,7 @@ static inline int info_get_rehash(snapraid_info info) } /** - * Mark the block address as with error. + * Marks the block address as with error. */ static inline snapraid_info info_set_bad(snapraid_info info) { @@ -746,7 +746,7 @@ static inline snapraid_info info_set_bad(snapraid_info info) /** - * Mark the block address as with rehash. + * Marks the block address as with rehash. */ static inline snapraid_info info_set_rehash(snapraid_info info) { diff --git a/scan.c b/scan.c index 56502591..70f25624 100644 --- a/scan.c +++ b/scan.c @@ -676,8 +676,8 @@ static int scan_dir(struct snapraid_scan* scan, struct snapraid_state* state, in } else if (S_ISDIR(st.st_mode)) { if (filter_dir(&state->filterlist, disk->name, sub_next) == 0) { #ifndef _WIN32 - /* in unix don't follow mount points in different devices */ - /* in windows, it's not clear how to check that */ + /* in Unix don't follow mount points in different devices */ + /* in Windows we are already skipping them reporting them as special files */ if (st.st_dev != disk->device) { fprintf(stderr, "warning: Ignoring mount point '%s' because it appears to be in a different device\n", path_next); } else diff --git a/scrub.c b/scrub.c index d46697f0..f1e90678 100644 --- a/scrub.c +++ b/scrub.c @@ -150,7 +150,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par ++autosavedone; --autosavemissing; - /* by default process the block, and skip it if something go wrong */ + /* by default process the block, and skip it if something goes wrong */ error_on_this_block = 0; silent_error_on_this_block = 0; @@ -202,6 +202,10 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par continue; } + /* note that we intentionally don't check 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. */ + read_size = handle_read(&handle[j], block, buffer[j], state->block_size, stderr); if (read_size == -1) { fprintf(stdlog, "error:%u:%s:%s: Read error at position %u\n", i, handle[j].disk->name, block_file_get(block)->sub, block_file_pos(block)); @@ -288,7 +292,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par if (error_on_this_block) { /* do nothing, as this is a generic error */ - /* maybe just caused by a not synched array */ + /* likely caused by a not synched array */ } else if (silent_error_on_this_block) { /* set the error status keeping the existing time and hash */ info_set(&state->infoarr, i, info_set_bad(info));