From 7ad4d26e0c4f8224624e1d3458040ce99c721558 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 10 Jun 2013 18:35:25 +0200 Subject: [PATCH] Fixes the computation of the expected parity size. --- state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);