]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
md/raid5: always set conf->prev_chunk_sectors and ->prev_algo
authorNeilBrown <neilb@suse.com>
Fri, 17 Jul 2015 02:17:50 +0000 (12:17 +1000)
committerNeilBrown <neilb@suse.com>
Mon, 31 Aug 2015 17:32:25 +0000 (19:32 +0200)
These aren't really needed when no reshape is happening,
but it is safer to have them always set to a meaningful value.
The next patch will use ->prev_chunk_sectors without checking
if a reshape is happening (because that makes the code simpler),
and this patch makes that safe.

Signed-off-by: NeilBrown <neilb@suse.com>
drivers/md/raid5.c

index 256b05d1117be643e4094703c01e9bd79b2aef9c..e543bfd7ae66ebc0c25ce867e94d6ee5da5923e1 100644 (file)
@@ -6568,6 +6568,9 @@ static struct r5conf *setup_conf(struct mddev *mddev)
        if (conf->reshape_progress != MaxSector) {
                conf->prev_chunk_sectors = mddev->chunk_sectors;
                conf->prev_algo = mddev->layout;
+       } else {
+               conf->prev_chunk_sectors = conf->chunk_sectors;
+               conf->prev_algo = conf->algorithm;
        }
 
        conf->min_nr_stripes = NR_STRIPES;