From ba0132eb8168d7baabba77981cbbeb1a4c981733 Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Tue, 24 Dec 2024 13:40:45 +0800 Subject: [PATCH 1/3] [BUG]update to mdadm-4.2-16 to #IBDC8P update to mdadm-4.2-16 for bugfix Signed-off-by: Zhao Hang --- ...ecking-subarray-state-in-update_suba.patch | 42 +++ ...r1-remove-support-for-name-in-config.patch | 267 ++++++++++++++++++ 1000-update-mdmonitor-oneshot.patch | 22 -- mdadm.spec | 32 +-- 4 files changed, 321 insertions(+), 42 deletions(-) create mode 100644 0167-manage-adjust-checking-subarray-state-in-update_suba.patch create mode 100644 0168-super1-remove-support-for-name-in-config.patch delete mode 100644 1000-update-mdmonitor-oneshot.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/0168-super1-remove-support-for-name-in-config.patch b/0168-super1-remove-support-for-name-in-config.patch new file mode 100644 index 0000000..39aa777 --- /dev/null +++ b/0168-super1-remove-support-for-name-in-config.patch @@ -0,0 +1,267 @@ +From dcc22ae74a864358b812327a423435b541789a36 Mon Sep 17 00:00:00 2001 +From: Mariusz Tkaczyk +Date: Thu, 1 Feb 2024 12:32:41 +0100 +Subject: [PATCH 1/1] super1: remove support for name= in config + +Only super1 provides "name=" to config. It is recoreded in metadata +so there is no need to duplicate same information. +UUID is our main key. + +It is not used by Incremental and Assemble handles empty name well +because other supertypes don't set it in conf. + +Expectation that the name in config is same as in metadata is bug prone. +Config should be the place where use can define customized settings. + +Remove printing "name=" from mdadm config creation commands. Ignore +the name in config file to keep backward compatibility. Remove +description from man mdadm.conf. + +Update 00conftest because "name" is no longer accepted. +As the name is ignored, error for mdadm --detail is not printed. + +Reported-by: Stefan Fleischmann +Fixes: e2eb503bd797 ("mdadm: Follow POSIX Portable Character Set") +Signed-off-by: Mariusz Tkaczyk +--- + config.c | 12 ++---- + mdadm.conf.5.in | 7 --- + super1.c | 8 ---- + tests/00confnames | 79 ++++++---------------------------- + tests/templates/names_template | 7 +-- + 5 files changed, 19 insertions(+), 94 deletions(-) + +diff --git a/config.c b/config.c +index 9a04cae8..44f7dd2f 100644 +--- a/config.c ++++ b/config.c +@@ -262,6 +262,7 @@ pass: + * @cmdline: context dependent actions. + * + * If criteria passed, set name in @ident. ++ * Note: name is not used by config file, it for cmdline only. + * + * Return: %MDADM_STATUS_SUCCESS or %MDADM_STATUS_ERROR. + */ +@@ -571,7 +572,8 @@ void arrayline(char *line) + mis.super_minor = minor; + } + } else if (strncasecmp(w, "name=", 5) == 0) { +- _ident_set_name(&mis, w + 5, false); ++ /* Ignore name in confile */ ++ continue; + } else if (strncasecmp(w, "bitmap=", 7) == 0) { + if (mis.bitmap_file) + pr_err("only specify bitmap file once. %s ignored\n", +@@ -1279,13 +1281,7 @@ struct mddev_ident *conf_match(struct supertype *st, + array_list->devname); + continue; + } +- if (array_list->name[0] && +- strcasecmp(array_list->name, info->name) != 0) { +- if (verbose >= 2 && array_list->devname) +- pr_err("Name differs from %s.\n", +- array_list->devname); +- continue; +- } ++ + if (array_list->devices && devname && + !match_oneof(array_list->devices, devname)) { + if (verbose >= 2 && array_list->devname) +diff --git a/mdadm.conf.5.in b/mdadm.conf.5.in +index 94e23dd0..787e51e9 100644 +--- a/mdadm.conf.5.in ++++ b/mdadm.conf.5.in +@@ -133,13 +133,6 @@ The value should be a 128 bit uuid in hexadecimal, with punctuation + interspersed if desired. This must match the uuid stored in the + superblock. + .TP +-.B name= +-The value should be a simple textual name as was given to +-.I mdadm +-when the array was created. This must match the name stored in the +-superblock on a device for that device to be included in the array. +-Not all superblock formats support names. +-.TP + .B super\-minor= + The value is an integer which indicates the minor number that was + stored in the superblock when the array was created. When an array is +diff --git a/super1.c b/super1.c +index dfde4629..5fd2228e 100644 +--- a/super1.c ++++ b/super1.c +@@ -645,10 +645,6 @@ static void brief_examine_super1(struct supertype *st, int verbose) + printf(":"); + printf("%02x", sb->set_uuid[i]); + } +- if (sb->set_name[0]) { +- printf(" name="); +- print_quoted(sb->set_name); +- } + printf("\n"); + } + +@@ -875,10 +871,6 @@ static void brief_detail_super1(struct supertype *st, char *subarray) + struct mdp_superblock_1 *sb = st->sb; + int i; + +- if (sb->set_name[0]) { +- printf(" name="); +- print_quoted(sb->set_name); +- } + printf(" UUID="); + for (i = 0; i < 16; i++) { + if ((i & 3) == 0 && i != 0) +diff --git a/tests/00confnames b/tests/00confnames +index 10823f01..191a905f 100644 +--- a/tests/00confnames ++++ b/tests/00confnames +@@ -1,10 +1,8 @@ + set -x -e + . tests/templates/names_template + +-# Test how and from config are handled during Incremental assemblation. +-# 1-6 only tests (no in config). +-# 6-10 and combinations are tested. +-# 11-13 corner cases. ++# Test how is handled during Incremental assemblation with ++# config file and ARRAYLINE specified. + + names_create "/dev/md/name" + local _UUID="$(mdadm -D --export /dev/md127 | grep MD_UUID | cut -d'=' -f2)" +@@ -12,96 +10,47 @@ local _UUID="$(mdadm -D --export /dev/md127 | grep MD_UUID | cut -d'=' -f2)" + + + # 1. definition consistent with metadata name. +-names_make_conf $_UUID "/dev/md/name" "empty" $config ++names_make_conf $_UUID "/dev/md/name" $config + mdadm -S "/dev/md127" + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "name" "name" + mdadm -S "/dev/md127" + + # 2. Same as 1, but use short name form of . +-names_make_conf $_UUID "name" "empty" $config ++names_make_conf $_UUID "name" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "name" "name" + mdadm -S "/dev/md127" + + # 3. Same as 1, but use different than metadata provides. +-names_make_conf $_UUID "/dev/md/other" "empty" $config ++names_make_conf $_UUID "/dev/md/other" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "other" "name" + mdadm -S "/dev/md127" + + # 4. Same as 3, but use short name form of . +-names_make_conf $_UUID "other" "empty" $config ++names_make_conf $_UUID "other" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "other" "name" + mdadm -S "/dev/md127" + +-# 5. Force particular node creation by setting to /dev/mdX. Link is not created in this +-# case. +-names_make_conf $_UUID "/dev/md4" "empty" $config ++# 5. Force particular node creation by setting to /dev/mdX. ++# Link is not created in this case. ++names_make_conf $_UUID "/dev/md4" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md4" "empty" "name" + mdadm -S "/dev/md4" + +-# 6. set to /dev/mdX, same as in metadata. +-# Metadata name and default node used - controversial. Current behavior documented. +-names_make_conf $_UUID "/dev/md22" "name" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 7. set to /dev/mdX, different than in metadata. +-# Metadata name and default node used - controversial. Current behavior documented. +-names_make_conf $_UUID "/dev/md8" "other" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 8. Both and different than in metadata. +-# Metadata name and default node used - controversial. Current behavior documented. +-names_make_conf $_UUID "devnode" "other_name" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 9. set to metadata name, different than in metadata. +-# Metadata name and default node used - controversial. Current behavior documented. +-names_make_conf $_UUID "name" "other_name" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 10. Bad set, no . +-# Metadata name and default node used - expected. +-names_make_conf $_UUID "/im/bad/devname" "empty" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 11. with some special symbols and locales, no . ++# 6. with some special symbols and locales. + # should be ignored. +-names_make_conf $_UUID "tźż-\.,<>st+-" "empty" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 12. No and set. +-# Metadata name and default node used - expected. +-names_make_conf $_UUID "empty" "empty" $config +-mdadm -I $dev0 --config=$config +-names_verify "/dev/md127" "name" "name" +-mdadm -S "/dev/md127" +- +-# 13. No , set to /dev/mdX. +-# Entry should be ignored, it is not ignored but result is good anyway. +-names_make_conf $_UUID "empty" "/dev/md12" $config ++names_make_conf $_UUID "tźż-\.,<>st+-" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "name" "name" + mdadm -S "/dev/md127" + +-# 13. No , with special symbols and locales. +-# Entry should be ignored, it is not ignored but result is good anyway. +-names_make_conf $_UUID "empty" "./\śćń#&" $config ++# 7. No set. ++# Metadata name and default node used. ++names_make_conf $_UUID "empty" $config + mdadm -I $dev0 --config=$config + names_verify "/dev/md127" "name" "name" + mdadm -S "/dev/md127" +diff --git a/tests/templates/names_template b/tests/templates/names_template +index 6181bfaa..1b6cd14b 100644 +--- a/tests/templates/names_template ++++ b/tests/templates/names_template +@@ -63,8 +63,7 @@ function names_verify() { + names_make_conf() { + local UUID="$1" + local WANTED_DEVNAME="$2" +- local WANTED_NAME="$3" +- local CONF="$4" ++ local CONF="$3" + + local LINE="ARRAY metadata=1.2 UUID=$UUID" + +@@ -72,9 +71,5 @@ names_make_conf() { + LINE="$LINE $WANTED_DEVNAME" + fi + +- if [[ "$WANTED_NAME" != "empty" ]]; then +- LINE="$LINE name=$WANTED_NAME" +- fi +- + echo $LINE > $CONF + } +-- +2.41.0 + diff --git a/1000-update-mdmonitor-oneshot.patch b/1000-update-mdmonitor-oneshot.patch deleted file mode 100644 index ce1a79a..0000000 --- a/1000-update-mdmonitor-oneshot.patch +++ /dev/null @@ -1,22 +0,0 @@ -From a7947c4b0594ea8e13936d697502067a915b661e Mon Sep 17 00:00:00 2001 -From: lww <12567360+lww12344@user.noreply.gitee.com> -Date: Tue, 21 May 2024 19:36:39 +0800 -Subject: [PATCH] update mdmonitor-oneshot - ---- - systemd/mdmonitor-oneshot.service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/systemd/mdmonitor-oneshot.service b/systemd/mdmonitor-oneshot.service -index ba86b44..b6c8186 100644 ---- a/systemd/mdmonitor-oneshot.service -+++ b/systemd/mdmonitor-oneshot.service -@@ -13,4 +13,4 @@ Documentation=man:mdadm(8) - Environment=MDADM_MONITOR_ARGS=--scan - EnvironmentFile=-/run/sysconfig/mdadm - ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh --ExecStart=BINDIR/mdadm --monitor --oneshot $MDADM_MONITOR_ARGS -+ExecStart=BINDIR/mdadm --monitor --oneshot --scan --syslog --- -2.39.3 - diff --git a/mdadm.spec b/mdadm.spec index 6531912..c5b6e80 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,11 +1,9 @@ -%define anolis_release .0.2 - 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 -Release: %{extraversion}%{anolis_release}%{?dist} +%define extraversion 16 +Release: %{extraversion}%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}%{?subversion:-%{subversion}}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -182,7 +180,8 @@ 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 -Patch1000: 1000-update-mdmonitor-oneshot.patch +Patch166: 0167-manage-adjust-checking-subarray-state-in-update_suba.patch +Patch167: 0168-super1-remove-support-for-name-in-config.patch # RHEL customization patches Patch200: mdadm-udev.patch @@ -211,14 +210,6 @@ package. However, mdadm is a single program, and it can perform almost all functions without a configuration file, though a configuration file can be used to help with some common tasks. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep %autosetup -p1 -n %{name}-%{version}%{?subversion:_%{subversion}} @@ -271,7 +262,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc COPYING misc/* +%doc TODO ChangeLog mdadm.conf-example COPYING misc/* %{_udevrulesdir}/* %{_sbindir}/* %{_unitdir}/* @@ -284,13 +275,14 @@ rm -rf %{buildroot} /etc/libreport/events.d/* /usr/share/mdadm/mdcheck -%files doc -%doc TODO ChangeLog mdadm.conf-example - %changelog -* Mon Jul 08 2024 Zhao Hang - 4.2-14.0.1 -- Add doc sub package -- update mdmonitor-onshot.service , ensure that the service starts successfully(lutw@ieisystem.com) +* Mon Oct 28 2024 Xiao Ni - 4.2-16 +- Remove name= support in config file +- Resolves RHEL-45608 + +* 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" -- Gitee From b71dc746b4efa4ea4d720f60da0179bcd01e2c60 Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Tue, 19 Jul 2022 16:14:18 +0800 Subject: [PATCH 2/3] spec: add doc sub package Signed-off-by: Zhao Hang --- mdadm.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mdadm.spec b/mdadm.spec index c5b6e80..4bfb90e 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,9 +1,11 @@ +%define anolis_release .0.1 + 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 16 -Release: %{extraversion}%{?dist} +Release: %{extraversion}%{anolis_release}%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}%{?subversion:-%{subversion}}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -210,6 +212,14 @@ package. However, mdadm is a single program, and it can perform almost all functions without a configuration file, though a configuration file can be used to help with some common tasks. +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Doc pages for %{name}. + %prep %autosetup -p1 -n %{name}-%{version}%{?subversion:_%{subversion}} @@ -262,7 +272,7 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc TODO ChangeLog mdadm.conf-example COPYING misc/* +%doc COPYING misc/* %{_udevrulesdir}/* %{_sbindir}/* %{_unitdir}/* @@ -275,7 +285,13 @@ rm -rf %{buildroot} /etc/libreport/events.d/* /usr/share/mdadm/mdcheck +%files doc +%doc TODO ChangeLog mdadm.conf-example + %changelog +* Tue Dec 24 2024 Zhao Hang - 4.2-16.0.1 +- Add doc sub package + * Mon Oct 28 2024 Xiao Ni - 4.2-16 - Remove name= support in config file - Resolves RHEL-45608 -- Gitee From af54dadd81f7ae7cd567ce8443a6b41c0126fca7 Mon Sep 17 00:00:00 2001 From: lww <12567360+lww12344@user.noreply.gitee.com> Date: Tue, 21 May 2024 19:49:17 +0800 Subject: [PATCH 3/3] update-mdmonitor-oneshot --- 1000-update-mdmonitor-oneshot.patch | 22 ++++++++++++++++++++++ mdadm.spec | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 1000-update-mdmonitor-oneshot.patch diff --git a/1000-update-mdmonitor-oneshot.patch b/1000-update-mdmonitor-oneshot.patch new file mode 100644 index 0000000..ce1a79a --- /dev/null +++ b/1000-update-mdmonitor-oneshot.patch @@ -0,0 +1,22 @@ +From a7947c4b0594ea8e13936d697502067a915b661e Mon Sep 17 00:00:00 2001 +From: lww <12567360+lww12344@user.noreply.gitee.com> +Date: Tue, 21 May 2024 19:36:39 +0800 +Subject: [PATCH] update mdmonitor-oneshot + +--- + systemd/mdmonitor-oneshot.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/systemd/mdmonitor-oneshot.service b/systemd/mdmonitor-oneshot.service +index ba86b44..b6c8186 100644 +--- a/systemd/mdmonitor-oneshot.service ++++ b/systemd/mdmonitor-oneshot.service +@@ -13,4 +13,4 @@ Documentation=man:mdadm(8) + Environment=MDADM_MONITOR_ARGS=--scan + EnvironmentFile=-/run/sysconfig/mdadm + ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh +-ExecStart=BINDIR/mdadm --monitor --oneshot $MDADM_MONITOR_ARGS ++ExecStart=BINDIR/mdadm --monitor --oneshot --scan --syslog +-- +2.39.3 + diff --git a/mdadm.spec b/mdadm.spec index 4bfb90e..98118dd 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -184,6 +184,7 @@ 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 Patch167: 0168-super1-remove-support-for-name-in-config.patch +Patch1000: 1000-update-mdmonitor-oneshot.patch # RHEL customization patches Patch200: mdadm-udev.patch @@ -291,6 +292,7 @@ rm -rf %{buildroot} %changelog * Tue Dec 24 2024 Zhao Hang - 4.2-16.0.1 - Add doc sub package +- update mdmonitor-onshot.service , ensure that the service starts successfully(lutw@ieisystem.com) * Mon Oct 28 2024 Xiao Ni - 4.2-16 - Remove name= support in config file -- Gitee