From 88ea55ea344966dd7d3b0f8724c7499d77e555de Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 10 Aug 2021 07:57:33 -0400 Subject: [PATCH] import mdadm-4.1-16.el8_4 --- ...LED-when-raid-has-not-enough-active-.patch | 50 +++++++++++++++++++ SPECS/mdadm.spec | 8 ++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0109-It-should-be-FAILED-when-raid-has-not-enough-active-.patch diff --git a/SOURCES/0109-It-should-be-FAILED-when-raid-has-not-enough-active-.patch b/SOURCES/0109-It-should-be-FAILED-when-raid-has-not-enough-active-.patch new file mode 100644 index 0000000..473eb39 --- /dev/null +++ b/SOURCES/0109-It-should-be-FAILED-when-raid-has-not-enough-active-.patch @@ -0,0 +1,50 @@ +From db5377883fef8655aac56b5d7ce5408f8ae494e0 Mon Sep 17 00:00:00 2001 +From: Xiao Ni +Date: Tue, 9 Feb 2021 17:39:51 +0800 +Subject: [PATCH 1/1] It should be FAILED when raid has not enough active disks + +It can't remove the disk if there are not enough disks. For example, raid5 can't remove the +second disk. If the second disk is unplug from machine, it's better show missing and the raid +should be FAILED. It's better for administrator to monitor the raid. + +Signed-off-by: Xiao Ni +Signed-off-by: Jes Sorensen +--- + Detail.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/Detail.c b/Detail.c +index f8dea6f..cd26fb0 100644 +--- a/Detail.c ++++ b/Detail.c +@@ -355,9 +355,14 @@ int Detail(char *dev, struct context *c) + avail = xcalloc(array.raid_disks, 1); + + for (d = 0; d < array.raid_disks; d++) { +- +- if ((disks[d*2].state & (1<prefer); ++ dv_rep = map_dev_preferred(disks[d*2+1].major, ++ disks[d*2+1].minor, 0, c->prefer); ++ ++ if ((dv && (disks[d*2].state & (1<brief) + printf("\n"); + } +-- +2.7.5 + diff --git a/SPECS/mdadm.spec b/SPECS/mdadm.spec index 4b2bcd5..d008b27 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: 15%{?dist} +Release: 16%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -122,6 +122,7 @@ Patch105: 0105-Make-target-to-install-binaries-only.patch Patch106: 0106-udev-start-grow-service-automatically.patch Patch107: 0107-Incremental-Remove-redundant-spare-movement-logic.patch Patch108: 0108-Dump-get-stat-from-a-wrong-metadata-file-when-restor.patch +Patch109: 0109-It-should-be-FAILED-when-raid-has-not-enough-active-.patch # RHEL customization patches Patch200: mdadm-3.3-udev.patch @@ -260,6 +261,7 @@ file can be used to help with some common tasks. %patch106 -p1 -b .0106 %patch107 -p1 -b .0107 %patch108 -p1 -b .0108 +%patch109 -p1 -b .0109 # RHEL customization patches %patch200 -p1 -b .udev @@ -331,6 +333,10 @@ rm -rf %{buildroot} /usr/lib/mdadm/mdadm_env.sh %changelog +* Thu Jun 10 2021 Xiao Ni - 4.1.16 +- Change the status to FAILED when raid has not enough active disks +- Resolves rhbz#1965414 + * Mon Jan 11 2021 Xiao Ni - 4.1.15 - Update to latest upstream - Resolves rhbz#1838005