From: NeilBrown Date: Wed, 19 Jun 2013 06:55:35 +0000 (+1000) Subject: Grow: a data_offset should not be tested against 0. X-Git-Tag: mdadm-3.3-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e09233d0482c73c727d34c8b6fa4a3536382341f;p=thirdparty%2Fmdadm.git Grow: a data_offset should not be tested against 0. It should always be tested against INVALID_SECTORS!!! Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index c3660828..afd40d30 100644 --- a/Grow.c +++ b/Grow.c @@ -2792,7 +2792,7 @@ 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) + if (reshape.backup_blocks == 0 && data_offset != INVALID_SECTORS) 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