mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Fix premature valid_size update before pwrite completion in parity_write
This commit is contained in:
parent
3288c8cc8c
commit
793782fa2d
1 changed files with 4 additions and 4 deletions
|
|
@ -861,10 +861,6 @@ int parity_write(struct snapraid_parity_handle* handle, block_off_t pos, unsigne
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* update the valid range */
|
||||
if (split->valid_size < offset + block_size)
|
||||
split->valid_size = offset + block_size;
|
||||
|
||||
bw_limit(handle->bw, block_size);
|
||||
|
||||
count = 0;
|
||||
|
|
@ -894,6 +890,10 @@ int parity_write(struct snapraid_parity_handle* handle, block_off_t pos, unsigne
|
|||
count += write_ret;
|
||||
} while (count < block_size);
|
||||
|
||||
/* update the valid range */
|
||||
if (split->valid_size < offset + block_size)
|
||||
split->valid_size = offset + block_size;
|
||||
|
||||
ret = advise_write(&split->advise, split->f, offset, block_size);
|
||||
if (ret != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue