diff --git a/state.c b/state.c index 4c2aace4..20f11862 100644 --- a/state.c +++ b/state.c @@ -921,10 +921,6 @@ void state_read(struct snapraid_state* state) exit(EXIT_FAILURE); } - /* keep track of the max block number */ - if (blockidx > blockmax) - blockmax = blockidx; - block = &file->blockvec[blockidx]; if (block->parity_pos != POS_INVALID) { @@ -951,6 +947,10 @@ void state_read(struct snapraid_state* state) block->parity_pos = v_pos; hash = oathash32(hash, v_pos); + /* keep track of the max block number used in parity */ + if (v_pos > blockmax) + blockmax = v_pos; + /* read the hash only for 'blk/inv/chg', and not for 'new' */ if (tag[0] != 'n') { c = sgetc(f);