From 3dadfb99e9d8dba0e98659dbdabad794ee428a22 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 10 Feb 2014 20:53:47 +0100 Subject: [PATCH] Keeps the fast sync mode as the default mode. --- Makefile.am | 4 ++-- snapraid.1 | 14 +++++++------- snapraid.c | 10 +++++----- snapraid.conf.example | 16 ++++++++-------- snapraid.conf.example.windows | 16 ++++++++-------- snapraid.d | 14 +++++++------- snapraid.txt | 14 +++++++------- state.c | 4 ++-- state.h | 2 +- sync.c | 2 +- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1c78caa0..4700ce8a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -398,11 +398,11 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test.log rm -r test/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Abort sync late with additions with rawsync and then delete the new additions and sync again + echo --- Abort sync late with additions with prehash and then delete the new additions and sync again cp -pR test/disk1/a test/disk1/a_copy cp -pR test/disk2/a test/disk2/a_copy cp -pR test/disk3/a test/disk3/a_copy - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync --test-rawsync -c $(CONF) sync + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync --test-prehash -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check rm -r test/disk1/a_copy rm -r test/disk2/a_copy diff --git a/snapraid.1 b/snapraid.1 index 5cd2d262..c52f5c61 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -974,17 +974,17 @@ commands interrupted by a machine crash, or any other event that may interrupt SnapRAID. The SIZE argument is specified in gibibytes. Where one gibi bytes is 1073741824 bytes. -.SS rawsync -Enables a single pass \(a"sync\(a" process avoding the initial hashing phase -and saving time. -In this mode no preliminary hashing is done, and the new data is hashed -directly during the parity computation when it\(cqs read for the first time, +.SS prehash +Enables a double pass \(a"sync\(a" process with an initial hashing phase. +In the default \(a"sync\(a" mode no preliminary hashing is done, and the new +data is hashed directly during the parity computation when it\(cqs read +for the first time, This happens when the system is under heavy pressure due all disks spinning and CPU busy, and in such extreme conditions, if your machine has a latent hardware problem, it\(cqs possible to encouter silent errors what cannot be detected because the data is not yet hashed. -To avoid this problem, this \(a"rawsync\(a" mode is by default disabled, -but if you really trust your hardware, you can enable it, and save time. +To avoid this risk, you can enable the \(a"prehash\(a" mode and have all the +data hashed two times to ensure its integrity. .SS pool DIR Defines the pooling directory where the virtual view of the disk array is created using the \(a"pool\(a" command. diff --git a/snapraid.c b/snapraid.c index 8dbba314..9fa705bf 100644 --- a/snapraid.c +++ b/snapraid.c @@ -104,7 +104,7 @@ void memory(void) #define OPT_TEST_FORCE_SCRUB_EVEN 272 #define OPT_TEST_FORCE_CONTENT_WRITE 273 #define OPT_TEST_FORCE_CONTENT_TEXT 274 -#define OPT_TEST_RAWSYNC 275 +#define OPT_TEST_PREHASH 275 #if HAVE_GETOPT_LONG struct option long_options[] = { @@ -186,8 +186,8 @@ struct option long_options[] = { /* Force the use of text content file . */ { "test-force-content-text", 0, 0, OPT_TEST_FORCE_CONTENT_TEXT }, - /* Like the rawsync configuration option. */ - { "test-rawsync", 0, 0, OPT_TEST_RAWSYNC }, + /* Like the prehash configuration option. */ + { "test-prehash", 0, 0, OPT_TEST_PREHASH }, { 0, 0, 0, 0 } }; @@ -457,8 +457,8 @@ int main(int argc, char* argv[]) case OPT_TEST_FORCE_CONTENT_TEXT : opt.force_content_text = 1; break; - case OPT_TEST_RAWSYNC : - opt.rawsync = 1; + case OPT_TEST_PREHASH : + opt.prehash = 1; break; default: /* LCOV_EXCL_START */ diff --git a/snapraid.conf.example b/snapraid.conf.example index 3ec4b54a..d3601467 100644 --- a/snapraid.conf.example +++ b/snapraid.conf.example @@ -63,19 +63,19 @@ exclude /lost+found/ # Format: "autosave SIZE_IN_GiB" #autosave 500 -# Enables a single pass "sync" process avoding the initial hashing phase -# and saving time. -# In this mode no preliminary hashing is done, and the new data is hashed -# directly during the parity computation when it's read for the first time, +# Enables a double pass "sync" process with an initial hashing phase. +# In the default "sync" mode no preliminary hashing is done, and the new +# data is hashed directly during the parity computation when it's read +# for the first time, # This happens when the system is under heavy pressure due all disks spinning # and CPU busy, and in such extreme conditions, if your machine has a latent # hardware problem, it's possible to encouter silent errors what cannot be # detected because the data is not yet hashed. -# To avoid this problem, this "rawsync" mode is by default disabled, -# but if you really trust your hardware, you can enable it, and save time. +# To avoid this risk, you can enable the "prehash" mode and have all the +# data hashed two times to ensure its integrity. # -# Format: rawsync -#rawsync +# Format: prehash +#prehash # Defines the pooling directory where the virtual view of the disk # array is created using the "pool" command (uncomment to enable). diff --git a/snapraid.conf.example.windows b/snapraid.conf.example.windows index 10fc35db..86ef72b1 100644 --- a/snapraid.conf.example.windows +++ b/snapraid.conf.example.windows @@ -67,19 +67,19 @@ exclude \Windows\ # Format: "autosave SIZE_IN_GiB" #autosave 500 -# Enables a single pass "sync" process avoding the initial hashing phase -# and saving time. -# In this mode no preliminary hashing is done, and the new data is hashed -# directly during the parity computation when it's read for the first time, +# Enables a double pass "sync" process with an initial hashing phase. +# In the default "sync" mode no preliminary hashing is done, and the new +# data is hashed directly during the parity computation when it's read +# for the first time, # This happens when the system is under heavy pressure due all disks spinning # and CPU busy, and in such extreme conditions, if your machine has a latent # hardware problem, it's possible to encouter silent errors what cannot be # detected because the data is not yet hashed. -# To avoid this problem, this "rawsync" mode is by default disabled, -# but if you really trust your hardware, you can enable it, and save time. +# To avoid this risk, you can enable the "prehash" mode and have all the +# data hashed two times to ensure its integrity. # -# Format: rawsync -#rawsync +# Format: prehash +#prehash # Defines the pooling directory where the virtual view of the disk # array is created using the "pool" command (uncomment to enable). diff --git a/snapraid.d b/snapraid.d index 3a39fe00..8fe815be 100644 --- a/snapraid.d +++ b/snapraid.d @@ -742,17 +742,17 @@ Configuration The SIZE argument is specified in gibibytes. Where one gibi bytes is 1073741824 bytes. - rawsync - Enables a single pass "sync" process avoding the initial hashing phase - and saving time. - In this mode no preliminary hashing is done, and the new data is hashed - directly during the parity computation when it's read for the first time, + prehash + Enables a double pass "sync" process with an initial hashing phase. + In the default "sync" mode no preliminary hashing is done, and the new + data is hashed directly during the parity computation when it's read + for the first time, This happens when the system is under heavy pressure due all disks spinning and CPU busy, and in such extreme conditions, if your machine has a latent hardware problem, it's possible to encouter silent errors what cannot be detected because the data is not yet hashed. - To avoid this problem, this "rawsync" mode is by default disabled, - but if you really trust your hardware, you can enable it, and save time. + To avoid this risk, you can enable the "prehash" mode and have all the + data hashed two times to ensure its integrity. pool DIR Defines the pooling directory where the virtual view of the disk diff --git a/snapraid.txt b/snapraid.txt index 5567ac07..f1c78caf 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -806,17 +806,17 @@ may interrupt SnapRAID. The SIZE argument is specified in gibibytes. Where one gibi bytes is 1073741824 bytes. ----- 7.8.2 rawsync ---- -Enables a single pass "sync" process avoding the initial hashing phase -and saving time. -In this mode no preliminary hashing is done, and the new data is hashed -directly during the parity computation when it's read for the first time, +---- 7.8.2 prehash ---- +Enables a double pass "sync" process with an initial hashing phase. +In the default "sync" mode no preliminary hashing is done, and the new +data is hashed directly during the parity computation when it's read +for the first time, This happens when the system is under heavy pressure due all disks spinning and CPU busy, and in such extreme conditions, if your machine has a latent hardware problem, it's possible to encouter silent errors what cannot be detected because the data is not yet hashed. -To avoid this problem, this "rawsync" mode is by default disabled, -but if you really trust your hardware, you can enable it, and save time. +To avoid this risk, you can enable the "prehash" mode and have all the +data hashed two times to ensure its integrity. ---- 7.8.3 pool DIR ---- Defines the pooling directory where the virtual view of the disk diff --git a/state.c b/state.c index 534419e9..e7ac80a2 100644 --- a/state.c +++ b/state.c @@ -681,8 +681,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co tommy_list_insert_tail(&state->disklist, &disk->node, disk); } else if (strcmp(tag, "nohidden") == 0) { state->filter_hidden = 1; - } else if (strcmp(tag, "rawsync") == 0) { - state->opt.rawsync = 1; + } else if (strcmp(tag, "prehash") == 0) { + state->opt.prehash = 1; } else if (strcmp(tag, "exclude") == 0) { struct snapraid_filter* filter; diff --git a/state.h b/state.h index c6eae279..efff46ef 100644 --- a/state.h +++ b/state.h @@ -59,7 +59,7 @@ struct snapraid_option { int verbose; /**< Verbose output. */ int quiet; /**< Quiet output. */ int gui; /**< Gui output. */ - int rawsync; /**< Enables the raw sync mode. */ + int prehash; /**< Enables the prehash mode. */ int force_zero; /**< Forced dangerous operations of synching files now with zero size. */ int force_empty; /**< Forced dangerous operations of synching disks now empty. */ int force_uuid; /**< Forced dangerous operations of synching disks with uuid changed. */ diff --git a/sync.c b/sync.c index 14e1c6c5..8027abde 100644 --- a/sync.c +++ b/sync.c @@ -1017,7 +1017,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t unrecoverable_error = 0; - if (!state->opt.rawsync) { + if (state->opt.prehash) { printf("Hashing...\n"); skip_sync = state_hash_process(state, blockstart, blockmax);