summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-10 15:43:04 +1100
committerNeilBrown <neilb@suse.de>2011-03-10 15:43:04 +1100
commitb3cf095a94848ab497477544cab3ea80c0643ea8 (patch)
tree719cdb7816ee1c1ec2b81396a71ce98811e60768
parent8ff6d0946cba047a1263f61142b6aa2f07381ee5 (diff)
downloadmdadm-b3cf095a94848ab497477544cab3ea80c0643ea8.tar.gz
Grow: don't forget_backup when length of backup is zero.
This is just a waste of IO Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Grow.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Grow.c b/Grow.c
index 7125a40..c11b1ce 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2990,19 +2990,23 @@ int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape,
/* Clear any backup region that is before 'here' */
if (increasing) {
- if (reshape_completed >= (__le64_to_cpu(bsb.arraystart) +
+ if (__le64_to_cpu(bsb.length) > 0 &&
+ reshape_completed >= (__le64_to_cpu(bsb.arraystart) +
__le64_to_cpu(bsb.length)))
forget_backup(dests, destfd,
destoffsets, 0);
- if (reshape_completed >= (__le64_to_cpu(bsb.arraystart2) +
+ if (__le64_to_cpu(bsb.length2) > 0 &&
+ reshape_completed >= (__le64_to_cpu(bsb.arraystart2) +
__le64_to_cpu(bsb.length2)))
forget_backup(dests, destfd,
destoffsets, 1);
} else {
- if (reshape_completed <= (__le64_to_cpu(bsb.arraystart)))
+ if (__le64_to_cpu(bsb.length) > 0 &&
+ reshape_completed <= (__le64_to_cpu(bsb.arraystart)))
forget_backup(dests, destfd,
destoffsets, 0);
- if (reshape_completed <= (__le64_to_cpu(bsb.arraystart2)))
+ if (__le64_to_cpu(bsb.length2) > 0 &&
+ reshape_completed <= (__le64_to_cpu(bsb.arraystart2)))
forget_backup(dests, destfd,
destoffsets, 1);
}