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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-01-12 10:44:58 +11:00
parent 223c5c999e
commit 60204e4e54
1 changed files with 16 additions and 5 deletions

21
Grow.c
View File

@ -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,