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

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