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

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