diff options
author | NeilBrown <neilb@suse.de> | 2015-04-08 09:36:55 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-04-08 09:39:02 +1000 |
commit | 330d6900bb4eea5d4dc407c2b547f48caf84f623 (patch) | |
tree | 96ba82ab391fd407113613b1e33034ebb61a7d28 /util.c | |
parent | d316dba7c9d337c7122a7ff5228f1a7f598b8d7d (diff) | |
download | mdadm-330d6900bb4eea5d4dc407c2b547f48caf84f623.tar.gz |
Assemble: allow a RAID4 to assemble easily when parity devices is missing.
If the parity device of a RAID4 is missing, then there is no immediate
risk to data. So it doesn't matter if the array is dirty or not.
This can be important when reshaping a RAID0, and is a much better
solution that that in the resent-reverted.
b720636a5849397dbc6dc1b0f0b671d17034a28b
Reported-by: "Jonathan Harker (Jesusaurus)" <jesusaurus@gentlydownthe.net>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -368,6 +368,13 @@ int enough(int level, int raid_disks, int layout, int clean, char *avail) case 1: return avail_disks >= 1; case 4: + if (avail_disks == raid_disks - 1 && + !avail[raid_disks - 1]) + /* If just the parity device is missing, then we + * have enough, even if not clean + */ + return 1; + /* FALL THROUGH */ case 5: if (clean) return avail_disks >= raid_disks-1; |