]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: set stripe_cache_size properly when restarting a reshape.
authorNeilBrown <neilb@suse.de>
Thu, 18 Dec 2008 03:24:41 +0000 (14:24 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 18 Dec 2008 03:24:41 +0000 (14:24 +1100)
Reshape with large chunk size can require a large stripe_cache.
We make this work when starting the reshape but not when
restarting at assemble time.  So fix that.

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

index 3ee028b461619a1379827e1bfce84c245a1aebfc..0cdeeda36e6306d4bda49dfb0c828bdcb31f9793 100644 (file)
@@ -934,6 +934,20 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                                                fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s");
                                        fprintf(stderr, ".\n");
                                }
+                               if (info.reshape_active &&
+                                   info.array.level >= 4 &&
+                                   info.array.level <= 6) {
+                                       /* might need to increase the size
+                                        * of the stripe cache - default is 256
+                                        */
+                                       if (256 < 4 * (info.array.chunk_size/4096)) {
+                                               struct mdinfo *sra = sysfs_read(mdfd, 0, 0);
+                                               if (sra)
+                                                       sysfs_set_num(sra, NULL,
+                                                                     "stripe_cache_size",
+                                                                     (4 * info.array.chunk_size / 4096) + 1);
+                                       }
+                               }
                                if (must_close) {
                                        int usecs = 1;
                                        close(mdfd);