Blame SOURCES/0020-Revert-mdadm-fix-coredump-of-mdadm-monitor-r.patch

cd8c44
From 190dc029b141c423e724566cbed5d5afbb10b05a Mon Sep 17 00:00:00 2001
cd8c44
From: Nigel Croxon <ncroxon@redhat.com>
cd8c44
Date: Mon, 18 Apr 2022 13:44:23 -0400
cd8c44
Subject: [PATCH 20/52] Revert "mdadm: fix coredump of mdadm --monitor -r"
cd8c44
cd8c44
This reverts commit 546047688e1c64638f462147c755b58119cabdc8.
cd8c44
cd8c44
The change from commit mdadm: fix coredump of mdadm
cd8c44
--monitor -r broke the printing of the return message when
cd8c44
passing -r to mdadm --manage, the removal of a device from
cd8c44
an array.
cd8c44
cd8c44
If the current code reverts this commit, both issues are
cd8c44
still fixed.
cd8c44
cd8c44
The original problem reported that the fix tried to address
cd8c44
was:  The --monitor -r option requires a parameter,
cd8c44
otherwise a null pointer will be manipulated when
cd8c44
converting to integer data, and a core dump will appear.
cd8c44
cd8c44
The original problem was really fixed with:
cd8c44
60815698c0a Refactor parse_num and use it to parse optarg.
cd8c44
Which added a check for NULL in 'optarg' before moving it
cd8c44
to the 'increments' variable.
cd8c44
cd8c44
New issue: When trying to remove a device using the short
cd8c44
argument -r, instead of the long argument --remove, the
cd8c44
output is empty. The problem started when commit
cd8c44
546047688e1c was added.
cd8c44
cd8c44
Steps to Reproduce:
cd8c44
1. create/assemble /dev/md0 device
cd8c44
2. mdadm --manage /dev/md0 -r /dev/vdxx
cd8c44
cd8c44
Actual results:
cd8c44
Nothing, empty output, nothing happens, the device is still
cd8c44
connected to the array.
cd8c44
cd8c44
The output should have stated "mdadm: hot remove failed
cd8c44
for /dev/vdxx: Device or resource busy", if the device was
cd8c44
still active. Or it should remove the device and print
cd8c44
a message:
cd8c44
cd8c44
mdadm: set /dev/vdd faulty in /dev/md0
cd8c44
mdadm: hot removed /dev/vdd from /dev/md0
cd8c44
cd8c44
The following commit should be reverted as it breaks
cd8c44
mdadm --manage -r.
cd8c44
cd8c44
commit 546047688e1c64638f462147c755b58119cabdc8
cd8c44
Author: Wu Guanghao <wuguanghao3@huawei.com>
cd8c44
Date:   Mon Aug 16 15:24:51 2021 +0800
cd8c44
mdadm: fix coredump of mdadm --monitor -r
cd8c44
cd8c44
-Nigel
cd8c44
cd8c44
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
cd8c44
Acked-by: Coly Li <colyli@suse.de>
cd8c44
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
cd8c44
---
cd8c44
 ReadMe.c | 6 +++---
cd8c44
 1 file changed, 3 insertions(+), 3 deletions(-)
cd8c44
cd8c44
diff --git a/ReadMe.c b/ReadMe.c
cd8c44
index 8f873c48..bec1be9a 100644
cd8c44
--- a/ReadMe.c
cd8c44
+++ b/ReadMe.c
cd8c44
@@ -81,11 +81,11 @@ char Version[] = "mdadm - v" VERSION " - " VERS_DATE EXTRAVERSION "\n";
cd8c44
  *     found, it is started.
cd8c44
  */
cd8c44
 
cd8c44
-char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:r:n:x:u:c:d:z:U:N:safRSow1tye:k";
cd8c44
+char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:";
cd8c44
 char short_bitmap_options[]=
cd8c44
-		"-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sarfRSow1tye:k:";
cd8c44
+		"-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:k:";
cd8c44
 char short_bitmap_auto_options[]=
cd8c44
-		"-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:r:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:";
cd8c44
+		"-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:k:";
cd8c44
 
cd8c44
 struct option long_options[] = {
cd8c44
     {"manage",    0, 0, ManageOpt},
cd8c44
-- 
cd8c44
2.31.1
cd8c44