Grow: --backup-file and --data-offset are incompatible.

So report if both are given, and if --backup-file is given,
don't try to update data-offset.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-05-21 16:40:23 +10:00
parent 9ad2a640fe
commit 8192902ff7
2 changed files with 9 additions and 3 deletions

7
Grow.c
View File

@ -2866,9 +2866,10 @@ started:
goto release;
}
switch(set_new_data_offset(sra, st, devname, info->delta_disks,
data_offset,
reshape.min_offset_change)) {
if (!backup_file)
switch(set_new_data_offset(sra, st, devname, info->delta_disks,
data_offset,
reshape.min_offset_change)) {
case -1:
goto release;
case 0:

View File

@ -1266,6 +1266,11 @@ int main(int argc, char *argv[])
c.require_homehost = 0;
}
if (c.backup_file && data_offset != INVALID_SECTORS) {
pr_err("--backup-file and --data-offset are incompatible\n");
exit(2);
}
if ((mode == MISC && devmode == 'E')
|| (mode == MONITOR && spare_sharing == 0))
/* Anyone may try this */;