mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Check the block state before getting the parity mapping
This case is not problematic, but we enforce the check order for consistency.
This commit is contained in:
parent
2df022c38b
commit
0c7ea790c3
1 changed files with 9 additions and 1 deletions
|
|
@ -365,12 +365,20 @@ static int file_is_full_invalid_parity_and_stable(struct snapraid_state* state,
|
|||
for (i = 0; i < file->blockmax; ++i) {
|
||||
snapraid_info info;
|
||||
struct snapraid_block* block = fs_file2block_get(file, i);
|
||||
block_off_t parity_pos = fs_file2par_get(disk, file, i);
|
||||
block_off_t parity_pos;
|
||||
|
||||
/* exclude blocks with parity */
|
||||
if (!block_has_invalid_parity(block))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Get the parity position, but only after checking
|
||||
* that the file has invalid parity.
|
||||
* This is not really required, as we are sure
|
||||
* that 'kept" files are mapped into parity.
|
||||
*/
|
||||
parity_pos = fs_file2par_get(disk, file, i);
|
||||
|
||||
/* get block specific info */
|
||||
info = info_get(&state->infoarr, parity_pos);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue