mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-19 22:46:36 -05:00
Ensure parity durability barrier in sync when there are no blocks to sync
This commit is contained in:
parent
8ed0224e41
commit
be3957f939
1 changed files with 14 additions and 1 deletions
|
|
@ -2181,7 +2181,20 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t
|
|||
}
|
||||
} else {
|
||||
msg_status("Nothing to sync.\n");
|
||||
sync_durable = 1;
|
||||
|
||||
/*
|
||||
* Ensure any parity files created or resized prior to this branch
|
||||
* are physically committed to disk before declaring sync durable.
|
||||
*/
|
||||
ret = state_barrier(state, 0, parity_handle, blockmax);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
++process_error;
|
||||
/* continue, as we are already exiting */
|
||||
/* LCOV_EXCL_STOP */
|
||||
} else {
|
||||
sync_durable = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue