From a37d3439b46cfd8d122ea1d0800d55615a1ede97 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 9 Feb 2016 19:12:32 +0100 Subject: [PATCH] Restore the -D, --force-device option to ignore the same device error --- HISTORY | 6 ++++++ cmdline/snapraid.c | 1 + cmdline/state.c | 12 ++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index 5237aa80..136d7982 100644 --- a/HISTORY +++ b/HISTORY @@ -29,6 +29,12 @@ SnapRAID HISTORY identify files. The 'status' command recommends to run 'touch' if required. +9.4 2016/02 +=========== + * Restores the functionality of the -D, --force-device option when used to + workaround the use of the same disk for two logical data drives when + running the 'fix' command. + 9.3 2016/01 =========== * Fixes an invalid assumption in the copy detection mechanism that diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index ce6332cc..cb76952e 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -867,6 +867,7 @@ int main(int argc, char* argv[]) switch (operation) { case OPERATION_FIX : + case OPERATION_CHECK : break; default : if (opt.force_device) { diff --git a/cmdline/state.c b/cmdline/state.c index dd49e0b4..ace696d2 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -273,9 +273,9 @@ static void state_config_check(struct snapraid_state* state, const char* path, t struct snapraid_disk* other = j->data; if (disk->device == other->device) { if (state->opt.force_device) { - /* mark disks to be skipped */ - disk->skip_access = 1; - other->skip_access = 1; + /* note tha we just ignore the issue */ + /* and we DON'T mark the disk to be skipped */ + /* because we want to use these disks */ if (!state->opt.no_warnings) log_fatal("DANGER! Ignoring that disks '%s' and '%s' are on the same device\n", disk->name, other->name); } else { @@ -354,9 +354,9 @@ static void state_config_check(struct snapraid_state* state, const char* path, t for (j = l + 1; j < state->level; ++j) { if (state->parity[l].device == state->parity[j].device) { if (state->opt.force_device) { - /* mark disks to be skipped */ - state->parity[l].skip_access = 1; - state->parity[j].skip_access = 1; + /* note tha we just ignore the issue */ + /* and we DON'T mark the disk to be skipped */ + /* because we want to use these disks */ if (!state->opt.no_warnings) log_fatal("DANGER! Skipping parities '%s' and '%s' on the same device\n", lev_config_name(l), lev_config_name(j)); } else {