summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-06-18 07:49:52 +0200
committerNeilBrown <neilb@suse.de>2015-06-18 07:49:52 +0200
commit56fcbcbb6f17df0e5dedf59744deee037c5d5fbd (patch)
tree365dedb030a2b4b95d891e0fbbfd4c422735136c /Assemble.c
parentGrow: fix a couple of typos. (diff)
downloadmdadm-56fcbcbb6f17df0e5dedf59744deee037c5d5fbd.tar.xz
mdadm-56fcbcbb6f17df0e5dedf59744deee037c5d5fbd.zip
Assemble: ensure stripe_cache is big enough to handle new chunk size
If you reshape to a larger chunk size, and need to restart, it can have problems. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index 42710a8a..f5c8dcd6 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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,