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

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