Skip to contentSkip to conversation

grow raid 6: different errors with mdadm 3.0.3 and 3.1

DISCUSSION Andrew Burgess 2 participants 3 messages Nov 24, 2009 – Nov 26, 2009 MD RAID

lore
Share & tools
lore
#0 lore raw

mdadm 3.0.3:

# mdadm -v /dev/md1 --grow --raid-devices=15
mdadm: Need to backup 19968K of critical section..
mdadm: /dev/md1: failed to save critical region

mdadm 3.1:

sudo ./mdadm -G /dev/md1 --raid-devices=15
mdadm: this change will reduce the size of the array.
use --grow --array-size first to truncate array. e.g. mdadm --grow /dev/md1 --array-size 928142080

Hmmm. Can I just echo something into /proc to make this happen? (assuming these are both mdadm bugs)

Or should I try another mdadm? I googled and a problem like #1 occured to someone using 3.0 and they worked around by using 2.6.7. But I'm starting to get nervous that mdadm may really be trying to stop me from doing something dumb...

New fc12 upgrade, kernel 2.6.31.5-127.fc12.x86_64

Thanks for any help

------------------------------

sudo ./mdadm -D /dev/md1
/dev/md1:

        Version : 1.02

Creation Time : Tue Sep 11 13:49:50 2007
Raid Level : raid6
Array Size : 8785916928 (8378.90 GiB 8996.78 GB)
Used Dev Size : 732159744 (698.24 GiB 749.73 GB)
Raid Devices : 14
Total Devices : 15
Persistence : Superblock is persistent

Update Time : Tue Nov 24 10:05:31 2009
State : clean
Active Devices : 14
Working Devices : 15
Failed Devices : 0
Spare Devices : 1

Layout : left-symmetric
Chunk Size : 128K

Name : 5
UUID : 5211e02e:19f8718e:8feeb699:03a4879f
Events : 9329236

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
10 8 113 1 active sync /dev/sdh1
2 8 65 2 active sync /dev/sde1
8 8 161 3 active sync /dev/sdk1
4 8 81 4 active sync /dev/sdf1
13 8 129 5 active sync /dev/sdi1
9 8 97 6 active sync /dev/sdg1
11 8 33 7 active sync /dev/sdc1
12 8 177 8 active sync /dev/sdl1
7 8 145 9 active sync /dev/sdj1
15 65 49 10 active sync /dev/sdt1
14 8 49 11 active sync /dev/sdd1
17 9 4 12 active sync /dev/md4
16 9 3 13 active sync /dev/md3

18 65 1 - spare /dev/sdq1

#1 lore raw
Quoted 14 lines · On Tue, 24 Nov 2009 10:21:39 -0800 Andrew Burgess <[email protected]> wrote:

mdadm 3.0.3:

# mdadm -v /dev/md1 --grow --raid-devices=15
mdadm: Need to backup 19968K of critical section..
mdadm: /dev/md1: failed to save critical region

mdadm 3.1:

sudo ./mdadm -G /dev/md1 --raid-devices=15
mdadm: this change will reduce the size of the array.
use --grow --array-size first to truncate array. e.g. mdadm --grow /dev/md1 --array-size 928142080

Quoted 7 lines

Hmmm. Can I just echo something into /proc to make this happen? (assuming these are both mdadm bugs)

Or should I try another mdadm? I googled and a problem like #1 occured to someone using 3.0 and they worked around by using 2.6.7. But I'm starting to get nervous that mdadm may really be trying to stop me from doing something dumb...

Thanks for the report.
There appears to be a big in mdadm-3.1.1 such that the new array size gets truncated to 32bits in this calculation so it looks like it is getting smaller.

The following patch will fix it, and can also be collected from my git tree (git://neil.brown.name/md).

Thanks,
NeilBrown

From 2ed4f75388f99968be58097941a9704f6e42d701 Mon Sep 17 00:00:00 2001
From: NeilBrown <[email protected]>
Date: Thu, 26 Nov 2009 14:19:26 +1100
Subject: [PATCH] Grow: avoid truncation error when checking size of array.

array.size is only 32bit so it is not safe to multiply it up before casting to (long long).
Actually, we shouldn't be using array.size here at all, but that will get fixed in a subsequent patch.

---
 Grow.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Grow.c +1 -1
index 7764bdb..a654d4e 100644
@@ -891,7 +891,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
 		}
 
 		/* Check that we can hold all the data */
-		size = ndata * array.size;
+		size = ndata * (long long)array.size;
 		get_dev_size(fd, NULL, &array_size);
 		if (size < (array_size/1024)) {
 			fprintf(stderr, Name ": this change will reduce the size of the array.\n"
Signature · 1 line
1.6.4.3
#2 lore raw
Quoted 11 lines · Neil Brown
Quoted 6 lines · On Tue, 24 Nov 2009 10:21:39 -0800 Andrew Burgess <[email protected]> wrote:

mdadm 3.1:

sudo ./mdadm -G /dev/md1 --raid-devices=15
mdadm: this change will reduce the size of the array.
use --grow --array-size first to truncate array. e.g. mdadm --grow /dev/md1 --array-size 928142080

Thanks for the report.

Thanks for the fix. I grabbed the git head version and the resize is grinding away now.