diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2022-06-22 22:25:11 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2022-08-07 22:27:59 +0200 |
commit | 6c9d9260633f2c8491985b0782cf0fbd7e51651b (patch) | |
tree | 624ffc9d3a33b064add609c27e75dd32376b96ee /mdadm.c | |
parent | monitor: Avoid segfault when calling NULL get_bad_blocks (diff) | |
download | mdadm-6c9d9260633f2c8491985b0782cf0fbd7e51651b.tar.xz mdadm-6c9d9260633f2c8491985b0782cf0fbd7e51651b.zip |
mdadm: Fix mdadm -r remove option regression
The commit noted below globally adds a parameter to the -r option but missed
the fact that -r is used for another purpose: --remove.
After that commit, a command such as:
mdadm /dev/md0 -r /dev/loop0
will do nothing seeing the device parameter will be consumed as a
argument to the -r option; thus, there will only be one device
seen one the command line, devs_found will only be 1 and nothing will
happen.
This caused the 01r5integ and 01raid6integ tests to hang indefinitely
as mdadm did not remove the failed device. With the device not removed,
it would not be readded. Then the loop waiting for the array status to
change would loop forever.
This commit was recently reverted, but the legitimate fix for the
monitor operations was still not fixed. So add specific monitor
short ops to re-fix the --monitor -r option.
Fixes: 546047688e1c ("mdadm: fix coredump of mdadm --monitor -r")
Fixes: 190dc029b141 ("Revert "mdadm: fix coredump of mdadm --monitor -r"")
Cc: Wu Guanghao <wuguanghao3@huawei.com>
Cc: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -227,6 +227,7 @@ int main(int argc, char *argv[]) shortopt = short_bitmap_auto_options; break; case 'F': newmode = MONITOR; + shortopt = short_monitor_options; break; case 'G': newmode = GROW; shortopt = short_bitmap_options; |