From 4df796109956b078dc7760fd2b50f0a1e0e3f71b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 18 Feb 2014 00:15:34 +0100 Subject: [PATCH] Fixes usage of scrub default settings. --- scrub.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scrub.c b/scrub.c index 6eed9fb1..defbf16a 100644 --- a/scrub.c +++ b/scrub.c @@ -508,17 +508,14 @@ int state_scrub(struct snapraid_state* state, int percentage, int olderthan) /* by default scrub 1/12 of the array */ countlimit = md(blockmax, 1, 12); + if (percentage != -1) + countlimit = md(blockmax, percentage, 100); + /* by default use a 10 day time limit */ recentlimit = now - 10 * 24 * 3600; - if (percentage != -1) - countlimit = md(blockmax, percentage, 100); - else - countlimit = blockmax; if (olderthan != -1) recentlimit = now - olderthan * 24 * 3600; - else - recentlimit = now; } /* identify the time limit */