summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-12-18 14:24:41 +1100
committerNeilBrown <neilb@suse.de>2008-12-18 14:24:41 +1100
commitacee8e896406b686d4b4f12bb748352d20ef83a5 (patch)
treef5f3ec4c01a0a1a906427211ffe621cf5b9a3a92 /Assemble.c
parent4e9a6ff778cdc58dcc6897e74cf5ee1d3f73e1f7 (diff)
downloadmdadm-acee8e896406b686d4b4f12bb748352d20ef83a5.tar.gz
mdadm-acee8e896406b686d4b4f12bb748352d20ef83a5.tar.xz
mdadm-acee8e896406b686d4b4f12bb748352d20ef83a5.zip
Assemble: set stripe_cache_size properly when restarting a reshape.
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>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Assemble.c b/Assemble.c
index 3ee028b..0cdeeda 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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);