From 33ddcd2669a29bb3670bb44dea0ca6cbe1d2cd56 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 22 2022 14:38:57 +0000 Subject: import mdadm-4.1-9.el7_9 --- diff --git a/SOURCES/0072-Incremental-Remove-redundant-spare-movement-logic.patch b/SOURCES/0072-Incremental-Remove-redundant-spare-movement-logic.patch new file mode 100644 index 0000000..e7e8985 --- /dev/null +++ b/SOURCES/0072-Incremental-Remove-redundant-spare-movement-logic.patch @@ -0,0 +1,111 @@ +From 69068584f9ed68b8b2736287a1c9863e11b741d5 Mon Sep 17 00:00:00 2001 +From: Mariusz Tkaczyk +Date: Fri, 11 Dec 2020 12:28:38 +0100 +Subject: [PATCH 1/1] Incremental: Remove redundant spare movement logic + +If policy is set then mdmonitor is responsible for moving spares. +This logic is reduntant and potentialy dangerus, spare could be moved at +initrd stage depending on drives appearance order. + +Remove it. + +Signed-off-by: Mariusz Tkaczyk +Signed-off-by: Jes Sorensen +--- + Incremental.c | 62 --------------------------------------------------- + 1 file changed, 62 deletions(-) + +diff --git a/Incremental.c b/Incremental.c +index ad9ec1cc..e849bdda 100644 +--- a/Incremental.c ++++ b/Incremental.c +@@ -1460,12 +1460,6 @@ static int Incremental_container(struct supertype *st, char *devname, + int trustworthy; + struct mddev_ident *match; + int rv = 0; +- struct domainlist *domains; +- struct map_ent *smp; +- int suuid[4]; +- int sfd; +- int ra_blocked = 0; +- int ra_all = 0; + int result = 0; + + st->ss->getinfo_super(st, &info, NULL); +@@ -1509,12 +1503,10 @@ static int Incremental_container(struct supertype *st, char *devname, + struct map_ent *mp; + struct mddev_ident *match = NULL; + +- ra_all++; + /* do not activate arrays blocked by metadata handler */ + if (ra->array.state & (1 << MD_SB_BLOCK_VOLUME)) { + pr_err("Cannot activate array %s in %s.\n", + ra->text_version, devname); +- ra_blocked++; + continue; + } + mp = map_by_uuid(&map, ra->uuid); +@@ -1617,60 +1609,6 @@ static int Incremental_container(struct supertype *st, char *devname, + } + printf("\n"); + } +- +- /* don't move spares to container with volume being activated +- when all volumes are blocked */ +- if (ra_all == ra_blocked) +- return 0; +- +- /* Now move all suitable spares from spare container */ +- domains = domain_from_array(list, st->ss->name); +- memcpy(suuid, uuid_zero, sizeof(int[4])); +- if (domains && +- (smp = map_by_uuid(&map, suuid)) != NULL && +- (sfd = open(smp->path, O_RDONLY)) >= 0) { +- /* spare container found */ +- struct supertype *sst = +- super_imsm.match_metadata_desc("imsm"); +- struct mdinfo *sinfo; +- +- if (!sst->ss->load_container(sst, sfd, NULL)) { +- struct spare_criteria sc = {0, 0}; +- +- if (st->ss->get_spare_criteria) +- st->ss->get_spare_criteria(st, &sc); +- +- close(sfd); +- sinfo = container_choose_spares(sst, &sc, +- domains, NULL, +- st->ss->name, 0); +- sst->ss->free_super(sst); +- if (sinfo){ +- int count = 0; +- struct mdinfo *disks = sinfo->devs; +- while (disks) { +- /* move spare from spare +- * container to currently +- * assembled one +- */ +- if (move_spare( +- smp->path, +- devname, +- makedev(disks->disk.major, +- disks->disk.minor))) +- count++; +- disks = disks->next; +- } +- if (count) +- pr_err("Added %d spare%s to %s\n", +- count, count>1?"s":"", devname); +- } +- sysfs_free(sinfo); +- } else +- close(sfd); +- } +- domain_free(domains); +- map_free(map); + return 0; + } + +-- +2.31.1 + diff --git a/SPECS/mdadm.spec b/SPECS/mdadm.spec index 4687bba..f42bec2 100644 --- a/SPECS/mdadm.spec +++ b/SPECS/mdadm.spec @@ -1,7 +1,7 @@ Summary: The mdadm program controls Linux md devices (software RAID arrays) Name: mdadm Version: 4.1 -Release: 8%{?dist} +Release: 9%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -82,6 +82,7 @@ Patch68: 0068-Monitor-improve-check_one_sharer-for-checking-duplic.patch Patch69: 0069-Detail-adding-sync-status-for-cluster-device.patch Patch70: 0070-Manage-imsm-Write-metadata-before-add.patch Patch71: 0071-Assemble-print-error-message-if-mdadm-fails-assembli.patch +Patch72: 0072-Incremental-Remove-redundant-spare-movement-logic.patch # RHEL customization patches Patch193: check-starttimer.patch @@ -186,6 +187,7 @@ file can be used to help with some common tasks. %patch69 -p1 -b .0069 %patch70 -p1 -b .0070 %patch71 -p1 -b .0071 +%patch72 -p1 -b .0072 # RHEL customization patches %patch193 -p1 -b .starttimer @@ -260,6 +262,10 @@ rm -rf %{buildroot} /usr/share/mdadm/mdcheck %changelog +* Mon Nov 08 2021 Xiao Ni - 4.1.9 +- imsm: After reboot put spare devices into right container. +- Resolves rhbz#2005306 + * Fri Sep 24 2021 Xiao Ni - 4.1.8 - mdcheck start timer starts failure - Resolves rhbz#1830736