forked from pool/mdadm
ceac01b560
- 0002-DDF-guard-against-pdnum-being-negative.patch - 0003-DDF-fix-possible-mdmon-crash-when-updating-metadata.patch - 0004-DDF-Don-t-fail-compare_super_ddf-due-to-re-configure.patch More upstream DDF fixes (bnc#866660) - 0001-mdmon-.service-Change-type-of-process-start-up-to-fo.patch - 0003-Work-around-architectures-having-statfs.f_type-defin.patch - 0004-DDF-report-seq-counter-as-events.patch - 0005-DDF-when-first-activating-an-array-record-any-missin.patch Two fixes for DDF (bnc#866660) and a couple of other upstream fixes just for good measure. - 0001-Assemble-allow-load_devices-to-change-the-st-which-i.patch 0002-Assemble-re-arrange-freeing-of-tst-in-load_devices.patch 0003-Assemble-change-load_devices-to-return-most_recent-s.patch Allow RAID5 to be assembled even when firs device listed recently failed (bnc#865221) OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=105
66 lines
1.9 KiB
Diff
66 lines
1.9 KiB
Diff
From 5a46fcd7f5b1bd1bf190784f112a15f383262af5 Mon Sep 17 00:00:00 2001
|
|
From: NeilBrown <neilb@suse.de>
|
|
Date: Wed, 26 Mar 2014 14:26:53 +1100
|
|
Subject: [PATCH 5/6] DDF: when first activating an array, record any missing
|
|
devices.
|
|
|
|
We must remember they are missing so that if they re-appear we
|
|
don't get confused.
|
|
|
|
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
---
|
|
super-ddf.c | 28 ++++++++++++++++++++++++++++
|
|
1 file changed, 28 insertions(+)
|
|
|
|
--- mdadm-3.3.orig/super-ddf.c
|
|
+++ mdadm-3.3/super-ddf.c
|
|
@@ -511,6 +511,8 @@ static void pr_state(const struct ddf_su
|
|
|
|
static void _ddf_set_updates_pending(struct ddf_super *ddf, const char *func)
|
|
{
|
|
+ if (ddf->updates_pending)
|
|
+ return;
|
|
ddf->updates_pending = 1;
|
|
ddf->active->seq = cpu_to_be32((be32_to_cpu(ddf->active->seq)+1));
|
|
pr_state(ddf, func);
|
|
@@ -4115,6 +4117,31 @@ static int ddf_open_new(struct supertype
|
|
return 0;
|
|
}
|
|
|
|
+static void handle_missing(struct ddf_super *ddf, int inst)
|
|
+{
|
|
+ /* This member array is being activated. If any devices
|
|
+ * are missing they must now be marked as failed.
|
|
+ */
|
|
+ struct vd_config *vc;
|
|
+ unsigned int n_bvd;
|
|
+ struct vcl *vcl;
|
|
+ struct dl *dl;
|
|
+ int n;
|
|
+
|
|
+ for (n = 0; ; n++) {
|
|
+ vc = find_vdcr(ddf, inst, n, &n_bvd, &vcl);
|
|
+ if (!vc)
|
|
+ break;
|
|
+ for (dl = ddf->dlist; dl; dl = dl->next)
|
|
+ if (be32_eq(dl->disk.refnum, vc->phys_refnum[n_bvd]))
|
|
+ break;
|
|
+ if (dl)
|
|
+ /* Found this disk, so not missing */
|
|
+ continue;
|
|
+ vc->phys_refnum[n_bvd] = cpu_to_be32(0);
|
|
+ }
|
|
+}
|
|
+
|
|
/*
|
|
* The array 'a' is to be marked clean in the metadata.
|
|
* If '->resync_start' is not ~(unsigned long long)0, then the array is only
|
|
@@ -4130,6 +4157,7 @@ static int ddf_set_array_state(struct ac
|
|
int inst = a->info.container_member;
|
|
int old = ddf->virt->entries[inst].state;
|
|
if (consistent == 2) {
|
|
+ handle_missing(ddf, inst);
|
|
/* Should check if a recovery should be started FIXME */
|
|
consistent = 1;
|
|
if (!is_resync_complete(&a->info))
|