2e35d7583b
- Update for latest mdadm-4.1+ patches, this is required by jsc#SLE-10078 and jsc#SLE-9348. Mostly the purpose is for latest Intel IMSM raid support. The following patches also include previous patches with new re-ordered prefix numbers. - Makefile: install mdadm_env.sh to /usr/lib/mdadm (bsc#1111960) 0000-Makefile-install-mdadm_env.sh-to-usr-lib-mdadm.patch - Assemble: keep MD_DISK_FAILFAST and MD_DISK_WRITEMOSTLY flag (jsc#SLE-10078, jsc#SLE-9348) 0001-Assemble-keep-MD_DISK_FAILFAST-and-MD_DISK_WRITEMOST.patch - Document PART-POLICY lines (jsc#SLE-10078, jsc#SLE-9348) 0002-Document-PART-POLICY-lines.patc - policy: support devices with multiple paths. (jsc#SLE-10078, jsc#SLE-9348) 0003-policy-support-devices-with-multiple-paths.patch - mdcheck: add systemd unit files to run mdcheck. (bsc#1115407) 0004-mdcheck-add-systemd-unit-files-to-run-mdcheck.patch - Monitor: add system timer to run --oneshot periodically (bsc#1115407) 0005-Monitor-add-system-timer-to-run-oneshot-periodically.patch - imsm: update metadata correctly while raid10 double (jsc#SLE-10078, jsc#SLE-9348) 0006-imsm-update-metadata-correctly-while-raid10-double-d.patch - Assemble: mask FAILFAST and WRITEMOSTLY flags when finding (jsc#SLE-10078, jsc#SLE-9348) 0007-Assemble-mask-FAILFAST-and-WRITEMOSTLY-flags-when-fi.patch - Grow: avoid overflow in compute_backup_blocks() (jsc#SLE-10078, jsc#SLE-9348) 0008-Grow-avoid-overflow-in-compute_backup_blocks.patch - Grow: report correct new chunk size. (jsc#SLE-10078, jsc#SLE-9348) 0009-Grow-report-correct-new-chunk-size.patch OBS-URL: https://build.opensuse.org/request/show/781064 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=181
49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
From 563ac108659980b3d1e226fe416254a86656235f Mon Sep 17 00:00:00 2001
|
|
From: Gioh Kim <gi-oh.kim@cloud.ionos.com>
|
|
Date: Tue, 6 Nov 2018 16:20:17 +0100
|
|
Subject: [PATCH] Assemble: mask FAILFAST and WRITEMOSTLY flags when finding
|
|
the most recent device
|
|
Git-commit: 563ac108659980b3d1e226fe416254a86656235f
|
|
Patch-mainline: mdadm-4.1+
|
|
References: jsc#SLE-10078, jsc#SLE-9348
|
|
|
|
If devices[].i.disk.state has MD_DISK_FAILFAST or MD_DISK_WRITEMOSTLY
|
|
flag, it cannot be the most recent device. Both flags should be masked
|
|
before checking the state.
|
|
|
|
Reviewed-by: NeilBrown <neilb@suse.com>
|
|
Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
|
|
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
|
|
Signed-off-by: Coly Li <colyli@suse.de>
|
|
|
|
---
|
|
Assemble.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/Assemble.c b/Assemble.c
|
|
index f39c9e1..9f75c68 100644
|
|
--- a/Assemble.c
|
|
+++ b/Assemble.c
|
|
@@ -578,6 +578,7 @@ static int load_devices(struct devs *devices, char *devmap,
|
|
struct supertype *tst;
|
|
int i;
|
|
int dfd;
|
|
+ int disk_state;
|
|
|
|
if (tmpdev->used != 1)
|
|
continue;
|
|
@@ -711,7 +712,9 @@ static int load_devices(struct devs *devices, char *devmap,
|
|
devices[devcnt].i.disk.major = major(stb.st_rdev);
|
|
devices[devcnt].i.disk.minor = minor(stb.st_rdev);
|
|
|
|
- if (devices[devcnt].i.disk.state == 6) {
|
|
+ disk_state = devices[devcnt].i.disk.state & ~((1<<MD_DISK_FAILFAST) |
|
|
+ (1<<MD_DISK_WRITEMOSTLY));
|
|
+ if (disk_state == ((1<<MD_DISK_ACTIVE) | (1<<MD_DISK_SYNC))) {
|
|
if (most_recent < 0 ||
|
|
devices[devcnt].i.events
|
|
> devices[most_recent].i.events) {
|
|
--
|
|
2.25.0
|
|
|