Adding upstream version 4.2+20230227.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c1504f9531
commit
d27d073420
2 changed files with 10 additions and 1 deletions
|
@ -292,6 +292,10 @@ struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4])
|
||||||
struct map_ent *map_by_devnm(struct map_ent **map, char *devnm)
|
struct map_ent *map_by_devnm(struct map_ent **map, char *devnm)
|
||||||
{
|
{
|
||||||
struct map_ent *mp;
|
struct map_ent *mp;
|
||||||
|
|
||||||
|
if (!devnm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (!*map)
|
if (!*map)
|
||||||
map_read(map);
|
map_read(map);
|
||||||
|
|
||||||
|
|
7
util.c
7
util.c
|
@ -1160,6 +1160,11 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
|
||||||
int i;
|
int i;
|
||||||
char *subarray = NULL;
|
char *subarray = NULL;
|
||||||
char container[32] = "";
|
char container[32] = "";
|
||||||
|
char *devnm = NULL;
|
||||||
|
|
||||||
|
devnm = fd2devnm(fd);
|
||||||
|
if (!devnm)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
sra = sysfs_read(fd, NULL, GET_VERSION);
|
sra = sysfs_read(fd, NULL, GET_VERSION);
|
||||||
|
|
||||||
|
@ -1205,7 +1210,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp)
|
||||||
if (subarrayp)
|
if (subarrayp)
|
||||||
*subarrayp = subarray;
|
*subarrayp = subarray;
|
||||||
strcpy(st->container_devnm, container);
|
strcpy(st->container_devnm, container);
|
||||||
strcpy(st->devnm, fd2devnm(fd));
|
strncpy(st->devnm, devnm, MD_NAME_MAX - 1);
|
||||||
} else
|
} else
|
||||||
free(subarray);
|
free(subarray);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue