]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: really ensure stripe_cache is bit enough to handle new chunk size
authorNeilBrown <neilb@suse.de>
Fri, 17 Jul 2015 03:10:25 +0000 (13:10 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 17 Jul 2015 03:10:25 +0000 (13:10 +1000)
Earlier patch:
  56fcbcbb6f17df0e5dedf59744deee037c5d5fbd
calculated the proper chunk size - but didn't use it..

Let's actually use it this time.

Signed-off-by: NeilBrown <neilb@suse.com>
Assemble.c

index f5c8dcd689b6adfe1f46d32ccd9bf9d7c58a1449..1960927340e66378b08f6cc9378d18f063facafc 100644 (file)
@@ -1113,12 +1113,12 @@ static int start_array(int mdfd,
                                if (content->reshape_active &&
                                    content->new_chunk > chunk_size)
                                        chunk_size = content->new_chunk;
-                               if (256 < 4 * ((content->array.chunk_size+4065)/4096)) {
+                               if (256 < 4 * ((chunk_size+4065)/4096)) {
                                        struct mdinfo *sra = sysfs_read(mdfd, NULL, 0);
                                        if (sra)
                                                sysfs_set_num(sra, NULL,
                                                              "stripe_cache_size",
-                                                             (4 * content->array.chunk_size / 4096) + 1);
+                                                             (4 * chunk_size / 4096) + 1);
                                        sysfs_free(sra);
                                }
                        }