]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: ensure stripe_cache is big enough to handle new chunk size
authorNeilBrown <neilb@suse.de>
Thu, 18 Jun 2015 05:49:52 +0000 (15:49 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 18 Jun 2015 05:49:52 +0000 (15:49 +1000)
If you reshape to a larger chunk size, and need to restart,
it can have problems.

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

index 42710a8a2dac9d1126637c748fce7232f550d6a4..f5c8dcd689b6adfe1f46d32ccd9bf9d7c58a1449 100644 (file)
@@ -1109,7 +1109,11 @@ static int start_array(int mdfd,
                                /* might need to increase the size
                                 * of the stripe cache - default is 256
                                 */
-                               if (256 < 4 * (content->array.chunk_size/4096)) {
+                               int chunk_size = content->array.chunk_size;
+                               if (content->reshape_active &&
+                                   content->new_chunk > chunk_size)
+                                       chunk_size = content->new_chunk;
+                               if (256 < 4 * ((content->array.chunk_size+4065)/4096)) {
                                        struct mdinfo *sra = sysfs_read(mdfd, NULL, 0);
                                        if (sra)
                                                sysfs_set_num(sra, NULL,