1
0
Fork 0

Merging upstream version 4.2+20230223.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-14 06:01:59 +01:00
parent 866376462c
commit 30ed170f74
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
76 changed files with 2282 additions and 1386 deletions

View file

@ -119,6 +119,34 @@ int match_keyword(char *word)
return -1;
}
/**
* ident_init() - Set defaults.
* @ident: ident pointer, not NULL.
*/
inline void ident_init(struct mddev_ident *ident)
{
assert(ident);
ident->assembled = false;
ident->autof = 0;
ident->bitmap_fd = -1;
ident->bitmap_file = NULL;
ident->container = NULL;
ident->devices = NULL;
ident->devname = NULL;
ident->level = UnSet;
ident->member = NULL;
ident->name[0] = 0;
ident->next = NULL;
ident->raid_disks = UnSet;
ident->spare_group = NULL;
ident->spare_disks = 0;
ident->st = NULL;
ident->super_minor = UnSet;
ident->uuid[0] = 0;
ident->uuid_set = 0;
}
struct conf_dev {
struct conf_dev *next;
char *name;
@ -194,7 +222,6 @@ struct mddev_dev *load_containers(void)
struct createinfo createinfo = {
.autof = 2, /* by default, create devices with standard names */
.symlinks = 1,
.names = 0, /* By default, stick with numbered md devices. */
.bblist = 1, /* Use a bad block list by default */
#ifdef DEBIAN
@ -310,11 +337,7 @@ static void createline(char *line)
if (!createinfo.supertype)
pr_err("metadata format %s unknown, ignoring\n",
w+9);
} else if (strncasecmp(w, "symlinks=yes", 12) == 0)
createinfo.symlinks = 1;
else if (strncasecmp(w, "symlinks=no", 11) == 0)
createinfo.symlinks = 0;
else if (strncasecmp(w, "names=yes", 12) == 0)
} else if (strncasecmp(w, "names=yes", 12) == 0)
createinfo.names = 1;
else if (strncasecmp(w, "names=no", 11) == 0)
createinfo.names = 0;
@ -368,22 +391,7 @@ void arrayline(char *line)
struct mddev_ident mis;
struct mddev_ident *mi;
mis.uuid_set = 0;
mis.super_minor = UnSet;
mis.level = UnSet;
mis.raid_disks = UnSet;
mis.spare_disks = 0;
mis.devices = NULL;
mis.devname = NULL;
mis.spare_group = NULL;
mis.autof = 0;
mis.next = NULL;
mis.st = NULL;
mis.bitmap_fd = -1;
mis.bitmap_file = NULL;
mis.name[0] = 0;
mis.container = NULL;
mis.member = NULL;
ident_init(&mis);
for (w = dl_next(line); w != line; w = dl_next(w)) {
if (w[0] == '/' || strchr(w, '=') == NULL) {