diff --git a/check.c b/check.c index e6500871..d49d0647 100644 --- a/check.c +++ b/check.c @@ -593,6 +593,8 @@ void state_check(struct snapraid_state* state, int fix, block_off_t blockstart, } pathcpy(parity_path, sizeof(parity_path), state->parity); + pathcpy(qarity_path, sizeof(qarity_path), state->qarity); + if (fix) { /* if fixing, create the file and open for writing */ /* if it fails, we cannot continue */ @@ -603,7 +605,6 @@ void state_check(struct snapraid_state* state, int fix, block_off_t blockstart, } if (state->level >= 2) { - pathcpy(qarity_path, sizeof(qarity_path), state->qarity); qarity_f = parity_create(qarity_path, size); if (qarity_f == -1) { fprintf(stderr, "WARNING! Without an accessible Q-Parity file, it isn't possible to fix any error.\n"); @@ -622,7 +623,6 @@ void state_check(struct snapraid_state* state, int fix, block_off_t blockstart, } if (state->level >= 2) { - pathcpy(qarity_path, sizeof(qarity_path), state->qarity); qarity_f = parity_open(qarity_path); if (qarity_f == -1) { printf("No accessible Q-Parity file, only files will be checked.\n"); diff --git a/sync.c b/sync.c index d43e6270..6ee5718c 100644 --- a/sync.c +++ b/sync.c @@ -287,6 +287,9 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t } pathcpy(parity_path, sizeof(parity_path), state->parity); + pathcpy(qarity_path, sizeof(qarity_path), state->qarity); + + /* create the file and open for writing */ parity_f = parity_create(parity_path, size); if (parity_f == -1) { fprintf(stderr, "WARNING! Without an accessible Parity file, it isn't possible to sync.\n"); @@ -294,7 +297,6 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t } if (state->level >= 2) { - pathcpy(qarity_path, sizeof(qarity_path), state->qarity); qarity_f = parity_create(qarity_path, size); if (qarity_f == -1) { fprintf(stderr, "WARNING! Without an accessible Q-Parity file, it isn't possible to sync.\n");