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
83 lines
2.5 KiB
Diff
83 lines
2.5 KiB
Diff
From df842e69a3cb7316a06ba45f8f04d7b9beb0170f Mon Sep 17 00:00:00 2001
|
|
From: NeilBrown <neilb@suse.de>
|
|
Date: Tue, 25 Feb 2014 14:54:34 +1100
|
|
Subject: [PATCH 1/3] Assemble: allow load_devices to change the 'st' which is
|
|
passed in.
|
|
|
|
The given 'st' might not be best. Making this interface change
|
|
will allow load_devices to return a better 'st'.
|
|
|
|
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
---
|
|
Assemble.c | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
--- mdadm-3.3.orig/Assemble.c
|
|
+++ mdadm-3.3/Assemble.c
|
|
@@ -551,7 +551,7 @@ struct devs {
|
|
};
|
|
|
|
static int load_devices(struct devs *devices, char *devmap,
|
|
- struct mddev_ident *ident, struct supertype *st,
|
|
+ struct mddev_ident *ident, struct supertype **stp,
|
|
struct mddev_dev *devlist, struct context *c,
|
|
struct mdinfo *content,
|
|
int mdfd, char *mddev,
|
|
@@ -567,6 +567,7 @@ static int load_devices(struct devs *dev
|
|
int most_recent = -1;
|
|
int bestcnt = 0;
|
|
int *best = *bestp;
|
|
+ struct supertype *st = *stp;
|
|
|
|
for (tmpdev = devlist; tmpdev; tmpdev=tmpdev->next) {
|
|
char *devname = tmpdev->devname;
|
|
@@ -610,6 +611,7 @@ static int load_devices(struct devs *dev
|
|
close(mdfd);
|
|
free(devices);
|
|
free(devmap);
|
|
+ *stp = st;
|
|
return -1;
|
|
}
|
|
tst->ss->getinfo_super(tst, content, devmap + devcnt * content->array.raid_disks);
|
|
@@ -636,6 +638,7 @@ static int load_devices(struct devs *dev
|
|
close(dfd);
|
|
free(devices);
|
|
free(devmap);
|
|
+ *stp = st;
|
|
return -1;
|
|
}
|
|
if (strcmp(c->update, "uuid")==0 &&
|
|
@@ -675,6 +678,7 @@ static int load_devices(struct devs *dev
|
|
close(mdfd);
|
|
free(devices);
|
|
free(devmap);
|
|
+ *stp = st;
|
|
return -1;
|
|
}
|
|
tst->ss->getinfo_super(tst, content, devmap + devcnt * content->array.raid_disks);
|
|
@@ -759,6 +763,7 @@ static int load_devices(struct devs *dev
|
|
close(mdfd);
|
|
free(devices);
|
|
free(devmap);
|
|
+ *stp = st;
|
|
return -1;
|
|
}
|
|
if (best[i] == -1
|
|
@@ -772,6 +777,7 @@ static int load_devices(struct devs *dev
|
|
*most_recentp = most_recent;
|
|
*bestcntp = bestcnt;
|
|
*bestp = best;
|
|
+ *stp = st;
|
|
return devcnt;
|
|
}
|
|
|
|
@@ -1432,7 +1438,7 @@ try_again:
|
|
/* Ok, no bad inconsistancy, we can try updating etc */
|
|
devices = xcalloc(num_devs, sizeof(*devices));
|
|
devmap = xcalloc(num_devs, content->array.raid_disks);
|
|
- devcnt = load_devices(devices, devmap, ident, st, devlist,
|
|
+ devcnt = load_devices(devices, devmap, ident, &st, devlist,
|
|
c, content, mdfd, mddev,
|
|
&most_recent, &bestcnt, &best, inargv);
|
|
if (devcnt < 0)
|