mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Allow dry to work without Q-Parity file.
This commit is contained in:
parent
4d49242350
commit
512dec9d68
1 changed files with 11 additions and 8 deletions
19
dry.c
19
dry.c
|
|
@ -102,10 +102,12 @@ static int state_dry_process(struct snapraid_state* state, int parity_f, int qar
|
|||
|
||||
/* read the qarity */
|
||||
if (state->level >= 2) {
|
||||
ret = parity_read(state->qarity, qarity_f, i, buffer, state->block_size);
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "%u: Syndrome read error\n", i);
|
||||
++error;
|
||||
if (qarity_f != -1) {
|
||||
ret = parity_read(state->qarity, qarity_f, i, buffer, state->block_size);
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "%u: Q-Parity read error\n", i);
|
||||
++error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,19 +179,20 @@ void state_dry(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
}
|
||||
|
||||
pathcpy(parity_path, sizeof(parity_path), state->parity);
|
||||
/* if drying, open the file for reading */
|
||||
pathcpy(qarity_path, sizeof(qarity_path), state->qarity);
|
||||
|
||||
/* open the file for reading */
|
||||
/* it may fail if the file doesn't exist, in this case we continue to dry the files */
|
||||
parity_f = parity_open(parity_path);
|
||||
if (parity_f == -1) {
|
||||
printf("No accessible parity file.\n");
|
||||
printf("No accessible Parity file.\n");
|
||||
/* continue anyway */
|
||||
}
|
||||
|
||||
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 qarity file.\n");
|
||||
printf("No accessible Q-Parity file.\n");
|
||||
/* continue anyway */
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue