summaryrefslogtreecommitdiffstats
path: root/mapfile.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 11:41:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 11:41:33 +0000
commite9922970d313f8bbf5440586f3020904ff7e057c (patch)
tree24090f3abf9370a2ff1ba6327d8c06c068f9c171 /mapfile.c
parentReleasing debian version 4.3+20240723-2. (diff)
downloadmdadm-e9922970d313f8bbf5440586f3020904ff7e057c.tar.xz
mdadm-e9922970d313f8bbf5440586f3020904ff7e057c.zip
Merging upstream version 4.3+20241108.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mapfile.c')
-rw-r--r--mapfile.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/mapfile.c b/mapfile.c
index ea9837a..33d40d9 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -43,6 +43,8 @@
* at compile time via MAP_DIR and MAP_FILE.
*/
#include "mdadm.h"
+#include "xmalloc.h"
+
#include <sys/file.h>
#include <ctype.h>
@@ -339,18 +341,14 @@ struct map_ent *map_by_name(struct map_ent **map, char *name)
*/
static char *get_member_info(struct mdstat_ent *ent)
{
+ char *subarray;
- if (ent->metadata_version == NULL ||
- strncmp(ent->metadata_version, "external:", 9) != 0)
+ if (!is_mdstat_ent_subarray(ent))
return NULL;
- if (is_subarray(&ent->metadata_version[9])) {
- char *subarray;
+ subarray = strrchr(ent->metadata_version, '/');
- subarray = strrchr(ent->metadata_version, '/');
- return subarray + 1;
- }
- return NULL;
+ return subarray + 1;
}
void RebuildMap(void)