From: NeilBrown Date: Tue, 11 Jan 2011 23:44:58 +0000 (+1100) Subject: Be more enthusiastic/flexible in backing up data. X-Git-Tag: mdadm-3.2~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60204e4e54c554fe1190d07635d96b8bdb71bb7f;p=thirdparty%2Fmdadm.git Be more enthusiastic/flexible in backing up data. At some points we need to perform 2 backups at once so as to start the 'double buffering' approach. So rather than assuming what the next backup should be, example suspend_point and backup as much as possible up to there. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 03a81e50..9816ff24 100644 --- a/Grow.c +++ b/Grow.c @@ -2822,18 +2822,29 @@ static int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape, break; } - if (rv) { + while (rv) { unsigned long long offset; - /* need to backup some space... */ + /* Need to backup some data. + * If 'part' is not used and the desired + * backup size is suspended, do a backup, + * then consider the next part. + */ /* Check that 'part' is unused */ if (part == 0 && __le64_to_cpu(bsb.length) != 0) - abort(); /* BUG here */ + break; if (part == 1 && __le64_to_cpu(bsb.length2) != 0) - abort(); + break; offset = backup_point / data; - if (!increasing) + if (increasing) { + if (offset + stripes * (chunk/512) > + suspend_point/data) + break; + } else { offset -= stripes * (chunk/512); + if (offset > suspend_point/data) + break; + } grow_backup(sra, offset, stripes, fds, offsets, disks, chunk, level, layout,