mdadm/0054-mdmon-don-t-test-both-all-and-container_name.patch
Coly Li 2e05bd3f7b Accepting request 1082557 from home:colyli:branches:openSUSE:Factory
- Fixes for mdmon to ensure it run at the right time in the
  fight mount namespace.  This fixes various problems with 
  IMSM raid arrays in 15-SP4 (bsc#1205493, bsc#1205830)
  - mdmon: fix segfault
    0052-mdmon-fix-segfault.patch
  - util: remove obsolete code from get_md_name
    0053-util-remove-obsolete-code-from-get_md_name.patch
  - mdmon: don't test both 'all' and 'container_name'.
    0054-mdmon-don-t-test-both-all-and-container_name.patch
  - mdmon: change systemd unit file to use --foreground
    0055-mdmon-change-systemd-unit-file-to-use-foreground.patch
  - mdmon: Remove need for KillMode=none
    0056-mdmon-Remove-need-for-KillMode-none.patch
  - mdmon: Improve switchroot interactions.
    0057-mdmon-Improve-switchroot-interactions.patch
  - mdopen: always try create_named_array()
    0058-mdopen-always-try-create_named_array.patch
  - Improvements for IMSM_NO_PLATFORM testing
    0059-Improvements-for-IMSM_NO_PLATFORM-testing.patch

OBS-URL: https://build.opensuse.org/request/show/1082557
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=223
2023-04-26 15:45:39 +00:00

48 lines
1.2 KiB
Diff

From d39fd87e31024804dd7f2c16c03af0379b71f5f1 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 13 Mar 2023 14:42:58 +1100
Subject: [PATCH] mdmon: don't test both 'all' and 'container_name'.
If 'all' is not set, then container_name must be NULL, as nothing else
can set it. So simplify the test to ignore container_name.
This makes the purpose of the code more obvious.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
---
mdmon.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mdmon.c b/mdmon.c
index 60ba318..f8fd2f0 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -352,7 +352,6 @@ int main(int argc, char *argv[])
}
}
-
if (in_initrd()) {
/*
* set first char of argv[0] to @. This is used by
@@ -362,12 +361,10 @@ int main(int argc, char *argv[])
argv[0][0] = '@';
}
- if (all == 0 && container_name == NULL) {
- if (argv[optind]) {
- container_name = get_md_name(argv[optind]);
- if (!container_name)
- return 1;
- }
+ if (!all && argv[optind]) {
+ container_name = get_md_name(argv[optind]);
+ if (!container_name)
+ return 1;
}
if (container_name == NULL || argc - optind > 1)
--
2.35.3