From f200a1f6b873685bf23b1320e472b5b6bfcf25c4 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 7 Dec 2014 00:06:53 +0100 Subject: [PATCH] Refreshes free space info also before first content write. --- cmdline/snapraid.c | 3 +++ cmdline/sync.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index f54912c1..8bfe8121 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -934,6 +934,9 @@ int main(int argc, char* argv[]) state_scan(&state, 0); + /* refresh the size info before the content write */ + state_refresh(state); + memory(); /* intercept Ctrl+C */ diff --git a/cmdline/sync.c b/cmdline/sync.c index a5b4cd7c..d8aa1f12 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -1110,7 +1110,7 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t } } - /* after opening and resizing parity files, refresh the free info */ + /* after resizing parity files, refresh again the free info */ state_refresh(state); unrecoverable_error = 0;