Grow: allow a reshape which only changes --data-offset

Sometimes, that is all we want to do.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-05-21 16:50:55 +10:00
parent d7e1f52bb8
commit 8876bf0bb6
2 changed files with 6 additions and 1 deletions

4
Grow.c
View File

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

View File

@ -1517,7 +1517,8 @@ int main(int argc, char *argv[])
mdfd, c.backup_file,
c.verbose);
else if (s.size > 0 || s.raiddisks || s.layout_str != NULL
|| s.chunk != 0 || s.level != UnSet) {
|| s.chunk != 0 || s.level != UnSet
|| data_offset != INVALID_SECTORS) {
rv = Grow_reshape(devlist->devname, mdfd,
devlist->next,
data_offset, &c, &s);