]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: a data_offset should not be tested against 0.
authorNeilBrown <neilb@suse.de>
Wed, 19 Jun 2013 06:55:35 +0000 (16:55 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 19 Jun 2013 06:55:35 +0000 (16:55 +1000)
It should always be tested against INVALID_SECTORS!!!

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index c366082895c992d8f6dcd5a3c1a98f4733bff58a..afd40d302a5c8a331d9ad2348a4e9e3d702e0496 100644 (file)
--- 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