diff options
author | NeilBrown <neilb@suse.de> | 2009-11-06 17:26:47 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-11-06 17:26:47 +1100 |
commit | 9ce510be9c71bae002a3b68ad138b164c908150a (patch) | |
tree | 9101397388c651cf7199068437ea41d1e405c40a /Grow.c | |
parent | b5ea446ae7c5548b9f3d88a474dc641a6910ddaf (diff) |
Grow: do not allow size changes with other changes.
A change the reduces the size of an array always happens
before any other change. So it can cause data to be lost.
By themselves these changes are reversible. But once another
change has started, the data would be permanently lost.
So recommend data integrity be checked between a size change
and any other change.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r-- | Grow.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -524,6 +524,15 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file, return 1; } + if (size >= 0 && + (chunksize || level!= UnSet || layout_str || raid_disks)) { + fprintf(stderr, Name ": cannot change component size at the same time " + "as other changes.\n" + " Change size first, then check data is intact before " + "making other changes.\n"); + return 1; + } + if (raid_disks && raid_disks < array.raid_disks && array.level > 1 && get_linux_version() < 2006032 && !check_env("MDADM_FORCE_FEWER")) { |