Merging upstream version 4.2+20230304.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2bc61998f8
commit
61538669fd
4 changed files with 19 additions and 7 deletions
1
Detail.c
1
Detail.c
|
@ -303,6 +303,7 @@ int Detail(char *dev, struct context *c)
|
||||||
if (path)
|
if (path)
|
||||||
printf("MD_DEVICE_%s_DEV=%s\n",
|
printf("MD_DEVICE_%s_DEV=%s\n",
|
||||||
sysdev, path);
|
sysdev, path);
|
||||||
|
free(sysdev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -1592,15 +1592,20 @@ static unsigned int get_vd_num_of_subarray(struct supertype *st)
|
||||||
sra = sysfs_read(-1, st->devnm, GET_VERSION);
|
sra = sysfs_read(-1, st->devnm, GET_VERSION);
|
||||||
if (!sra || sra->array.major_version != -1 ||
|
if (!sra || sra->array.major_version != -1 ||
|
||||||
sra->array.minor_version != -2 ||
|
sra->array.minor_version != -2 ||
|
||||||
!is_subarray(sra->text_version))
|
!is_subarray(sra->text_version)) {
|
||||||
|
if (sra)
|
||||||
|
sysfs_free(sra);
|
||||||
return DDF_NOTFOUND;
|
return DDF_NOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
sub = strchr(sra->text_version + 1, '/');
|
sub = strchr(sra->text_version + 1, '/');
|
||||||
if (sub != NULL)
|
if (sub != NULL)
|
||||||
vcnum = strtoul(sub + 1, &end, 10);
|
vcnum = strtoul(sub + 1, &end, 10);
|
||||||
if (sub == NULL || *sub == '\0' || *end != '\0' ||
|
if (sub == NULL || *sub == '\0' || *end != '\0' ||
|
||||||
vcnum >= be16_to_cpu(ddf->active->max_vd_entries))
|
vcnum >= be16_to_cpu(ddf->active->max_vd_entries)) {
|
||||||
|
sysfs_free(sra);
|
||||||
return DDF_NOTFOUND;
|
return DDF_NOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
return vcnum;
|
return vcnum;
|
||||||
}
|
}
|
||||||
|
|
|
@ -713,12 +713,12 @@ static struct sys_dev* find_disk_attached_hba(int fd, const char *devname)
|
||||||
|
|
||||||
for (elem = list; elem; elem = elem->next)
|
for (elem = list; elem; elem = elem->next)
|
||||||
if (path_attached_to_hba(disk_path, elem->path))
|
if (path_attached_to_hba(disk_path, elem->path))
|
||||||
return elem;
|
break;
|
||||||
|
|
||||||
if (disk_path != devname)
|
if (disk_path != devname)
|
||||||
free(disk_path);
|
free(disk_path);
|
||||||
|
|
||||||
return NULL;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int find_intel_hba_capability(int fd, struct intel_super *super,
|
static int find_intel_hba_capability(int fd, struct intel_super *super,
|
||||||
|
@ -4515,6 +4515,7 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname)
|
||||||
MIGR_REC_BUF_SECTORS*MAX_SECTOR_SIZE) != 0) {
|
MIGR_REC_BUF_SECTORS*MAX_SECTOR_SIZE) != 0) {
|
||||||
pr_err("could not allocate migr_rec buffer\n");
|
pr_err("could not allocate migr_rec buffer\n");
|
||||||
free(super->buf);
|
free(super->buf);
|
||||||
|
super->buf = NULL;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
super->clean_migration_record_by_mdmon = 0;
|
super->clean_migration_record_by_mdmon = 0;
|
||||||
|
|
11
util.c
11
util.c
|
@ -421,14 +421,19 @@ int parse_layout_10(char *layout)
|
||||||
|
|
||||||
int parse_layout_faulty(char *layout)
|
int parse_layout_faulty(char *layout)
|
||||||
{
|
{
|
||||||
|
int ln, mode;
|
||||||
|
char *m;
|
||||||
|
|
||||||
if (!layout)
|
if (!layout)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Parse the layout string for 'faulty' */
|
/* Parse the layout string for 'faulty' */
|
||||||
int ln = strcspn(layout, "0123456789");
|
ln = strcspn(layout, "0123456789");
|
||||||
char *m = xstrdup(layout);
|
m = xstrdup(layout);
|
||||||
int mode;
|
|
||||||
m[ln] = 0;
|
m[ln] = 0;
|
||||||
mode = map_name(faultylayout, m);
|
mode = map_name(faultylayout, m);
|
||||||
|
free(m);
|
||||||
|
|
||||||
if (mode == UnSet)
|
if (mode == UnSet)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue