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
76 lines
2.4 KiB
Diff
76 lines
2.4 KiB
Diff
From e5a03804dc27e662be94290c62760dbc544c0211 Mon Sep 17 00:00:00 2001
|
|
From: NeilBrown <neilb@suse.de>
|
|
Date: Tue, 1 Apr 2014 16:15:06 +1100
|
|
Subject: [PATCH 1/4] DDF: mark missing-on-assembly device properly.
|
|
|
|
As well as removing from the array we really should mark
|
|
it is 'failed', and mark the array as degraded.
|
|
|
|
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
---
|
|
super-ddf.c | 31 ++++++++++++++++++++++++++++---
|
|
1 file changed, 28 insertions(+), 3 deletions(-)
|
|
|
|
--- mdadm-3.3.orig/super-ddf.c
|
|
+++ mdadm-3.3/super-ddf.c
|
|
@@ -4117,7 +4117,7 @@ static int ddf_open_new(struct supertype
|
|
return 0;
|
|
}
|
|
|
|
-static void handle_missing(struct ddf_super *ddf, int inst)
|
|
+static void handle_missing(struct ddf_super *ddf, struct active_array *a, int inst)
|
|
{
|
|
/* This member array is being activated. If any devices
|
|
* are missing they must now be marked as failed.
|
|
@@ -4126,7 +4126,9 @@ static void handle_missing(struct ddf_su
|
|
unsigned int n_bvd;
|
|
struct vcl *vcl;
|
|
struct dl *dl;
|
|
+ int pd;
|
|
int n;
|
|
+ int state;
|
|
|
|
for (n = 0; ; n++) {
|
|
vc = find_vdcr(ddf, inst, n, &n_bvd, &vcl);
|
|
@@ -4138,7 +4140,30 @@ static void handle_missing(struct ddf_su
|
|
if (dl)
|
|
/* Found this disk, so not missing */
|
|
continue;
|
|
- vc->phys_refnum[n_bvd] = cpu_to_be32(0);
|
|
+
|
|
+ /* Mark the device as failed/missing. */
|
|
+ pd = find_phys(ddf, vc->phys_refnum[n_bvd]);
|
|
+ if (pd >= 0 && be16_and(ddf->phys->entries[pd].state,
|
|
+ cpu_to_be16(DDF_Online))) {
|
|
+ be16_clear(ddf->phys->entries[pd].state,
|
|
+ cpu_to_be16(DDF_Online));
|
|
+ be16_set(ddf->phys->entries[pd].state,
|
|
+ cpu_to_be16(DDF_Failed|DDF_Missing));
|
|
+ vc->phys_refnum[n_bvd] = cpu_to_be32(0);
|
|
+ ddf_set_updates_pending(ddf);
|
|
+ }
|
|
+
|
|
+ /* Mark the array as Degraded */
|
|
+ state = get_svd_state(ddf, vcl);
|
|
+ if (ddf->virt->entries[inst].state !=
|
|
+ ((ddf->virt->entries[inst].state & ~DDF_state_mask)
|
|
+ | state)) {
|
|
+ ddf->virt->entries[inst].state =
|
|
+ (ddf->virt->entries[inst].state & ~DDF_state_mask)
|
|
+ | state;
|
|
+ a->check_degraded = 1;
|
|
+ ddf_set_updates_pending(ddf);
|
|
+ }
|
|
}
|
|
}
|
|
|
|
@@ -4157,7 +4182,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);
|
|
+ handle_missing(ddf, a, inst);
|
|
/* Should check if a recovery should be started FIXME */
|
|
consistent = 1;
|
|
if (!is_resync_complete(&a->info))
|