mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Fix parity writer error propagation in io_flush and abort sync on parity write failures
This commit is contained in:
parent
fa0a77f84c
commit
ef6fa54ee2
4 changed files with 69 additions and 27 deletions
|
|
@ -5878,8 +5878,19 @@ int state_flush(struct snapraid_state* state, struct snapraid_io* io, struct sna
|
|||
{
|
||||
unsigned l;
|
||||
|
||||
if (io)
|
||||
io_flush(io);
|
||||
if (io) {
|
||||
int writer_error[IO_WRITER_ERROR_MAX];
|
||||
unsigned j;
|
||||
|
||||
io_flush(io, writer_error);
|
||||
|
||||
for (j = 0; j < IO_WRITER_ERROR_MAX; ++j) {
|
||||
if (writer_error[j]) {
|
||||
errno = EIO;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* flush all parity handles to ensure data is written to disk */
|
||||
for (l = 0; l < state->level; ++l) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue