summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-21 08:50:55 +0200
committerNeilBrown <neilb@suse.de>2013-05-22 04:27:40 +0200
commit8876bf0bb66d8437cd91607417ada386add14d04 (patch)
tree5fd89b2778d3c4e639f3f8389dc82441961fe1d5 /Grow.c
parentGrow: E2BIG should be reporte differently if --data-offset was requested. (diff)
downloadmdadm-8876bf0bb66d8437cd91607417ada386add14d04.tar.xz
mdadm-8876bf0bb66d8437cd91607417ada386add14d04.zip
Grow: allow a reshape which only changes --data-offset
Sometimes, that is all we want to do. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index 82f3cc17..7b9cc70e 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1875,6 +1875,7 @@ size_change_error:
if ((s->level == UnSet || s->level == array.level) &&
(s->layout_str == NULL) &&
(s->chunk == 0 || s->chunk == array.chunk_size) &&
+ data_offset == INVALID_SECTORS &&
(s->raiddisks == 0 || s->raiddisks == array.raid_disks)) {
/* Nothing more to do */
if (!changed && c->verbose >= 0)
@@ -2757,6 +2758,9 @@ static int reshape_array(char *container, int fd, char *devname,
Manage_subdevs(devname, fd, devlist, verbose,
0,NULL, 0);
+
+ if (reshape.backup_blocks == 0 && data_offset)
+ reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
if (reshape.backup_blocks == 0) {
/* No restriping needed, but we might need to impose
* some more changes: layout, raid_disks, chunk_size