From 91811c56bab429eabdb0193444969c258f555f58 Mon Sep 17 00:00:00 2001 From: Xiao Ni Date: Thu, 28 Mar 2024 15:48:35 +0800 Subject: [PATCH] Fix update_subarray on active volume - missing patch This is used to fix 8.10.z branch. But 8.10 is the terminal stream. So I still need to push the change to 8.10 centos stream. Then build the 8.10.z stream in rhel internal dist. Resolves: RHEL-20833 Signed-off-by: Xiao Ni --- ...ecking-subarray-state-in-update_suba.patch | 42 +++++++++++++++++++ mdadm.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0167-manage-adjust-checking-subarray-state-in-update_suba.patch diff --git a/0167-manage-adjust-checking-subarray-state-in-update_suba.patch b/0167-manage-adjust-checking-subarray-state-in-update_suba.patch new file mode 100644 index 0000000..ed47f29 --- /dev/null +++ b/0167-manage-adjust-checking-subarray-state-in-update_suba.patch @@ -0,0 +1,42 @@ +From 582945c2d3bbead4a71de521a392e292a4a84e24 Mon Sep 17 00:00:00 2001 +From: Pawel Piatkowski +Date: Wed, 20 Dec 2023 10:32:49 +0100 +Subject: [PATCH 1/1] manage: adjust checking subarray state in update_subarray + +Only changing bitmap related consistency_policy requires +subarray to be inactive. +consistency_policy with PPL or NO_PPL value can be changed on +active subarray. +It fixes regression introduced in commit +db10eab68e652f141169 ("Fix --update-subarray on active volume") + +Signed-off-by: Pawel Piatkowski +Signed-off-by: Mariusz Tkaczyk +--- + Manage.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Manage.c b/Manage.c +index f0d4cb01..91532266 100644 +--- a/Manage.c ++++ b/Manage.c +@@ -1749,6 +1749,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update, + int fd, rv = 2; + struct mdinfo *info = NULL; + char *update_verb = map_num(update_options, update); ++ bool allow_active = update == UOPT_PPL || update == UOPT_NO_PPL; + + memset(st, 0, sizeof(*st)); + +@@ -1763,7 +1764,7 @@ int Update_subarray(char *dev, char *subarray, enum update_opt update, + goto free_super; + } + +- if (is_subarray_active(subarray, st->devnm)) { ++ if (!allow_active && is_subarray_active(subarray, st->devnm)) { + if (verbose >= 0) + pr_err("Subarray %s in %s is active, cannot update %s\n", + subarray, dev, update_verb); +-- +2.40.1 + diff --git a/mdadm.spec b/mdadm.spec index 31e3c13..4086c2d 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -2,7 +2,7 @@ Summary: The mdadm program controls Linux md devices (software RAID arrays) Name: mdadm Version: 4.2 # extraversion is used to define rhel internal version -%define extraversion 14 +%define extraversion 15 Release: %{extraversion}%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}%{?subversion:-%{subversion}}.tar.xz Source1: mdmonitor.init @@ -180,6 +180,7 @@ Patch162: 0163-mdadm-super1-Add-MD_FEATURE_RAID0_LAYOUT-if-kernel-5.patch Patch163: 0164-mdadm-remove-container_enough-logic.patch Patch164: 0165-Fix-assembling-RAID-volume-by-using-incremental.patch Patch165: 0166-Revert-mdadm-remove-container_enough-logic.patch +Patch166: 0167-manage-adjust-checking-subarray-state-in-update_suba.patch # RHEL customization patches Patch200: mdadm-udev.patch @@ -274,6 +275,10 @@ rm -rf %{buildroot} /usr/share/mdadm/mdcheck %changelog +* Thu Mar 28 2024 Xiao Ni - 4.2-15 +- Fix update_subarray on active volume - missing patch +- Resolves RHEL-20833 + * Fri Mar 15 2024 Xiao Ni - 4.2-14 - Revert "mdadm: remove container_enough logic" - Resolves RHEL-26274