diff options
author | NeilBrown <neilb@suse.de> | 2013-05-21 16:32:00 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-05-22 12:26:19 +1000 |
commit | c4b26c643dd8dd4e897288345dad7ecbe318e243 (patch) | |
tree | 14ae89b8e83975eceeb4f68c60594f5f5f9a0479 /super1.c | |
parent | 63c12c89d4bed2cfbf9d263b968563741bb37d2c (diff) |
Grow: allow metadata to indicate that changing data_offset not supported.
If space_after and space_before are zero (the default) then assume that
metadata doesn't support changing data_offset.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super1.c')
-rw-r--r-- | super1.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -953,6 +953,14 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->space_before = 0; info->space_after = misc->device_size - data_size - info->data_offset; } + if (info->space_before == 0 && info->space_after == 0) { + /* It will look like we don't support data_offset changes, + * be we do - it's just that there is no room. + * A change that reduced the number of devices should + * still be allowed, so set the otherwise useless value of '1' + */ + info->space_after = 1; + } info->disk.raid_disk = -1; switch(role) { |