Skip to contentSkip to conversation

mdadm: Fix building errors

PATCH Applied Xiao Ni 2 participants 2 messages Jun 22, 2021 – Jul 16, 2021 MD RAID

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

PATCH 1/1 mdadm: Fix building errors

In util.c, there is a building error:
'/md/metadata_version' directive writing 20 bytes into a region of size between 0 and 255 [-Werror=format-overflow=]

In mapfile.c
It declares the fouth argument as 'int *' in map_update, but in mdadm.h it's previously declared as an array 'int[4]'

---
 mapfile.c | 2 +-
 util.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
mapfile.c +1 -1
index 8d7acb3..6b2207d 100644
@@ -215,7 +215,7 @@ void map_free(struct map_ent *map)
 }
 
 int map_update(struct map_ent **mpp, char *devnm, char *metadata,
-	       int *uuid, char *path)
+	       int uuid[4], char *path)
 {
 	struct map_ent *map, *mp;
 	int rv;
util.c +1 -1
index 5879694..cdf1da2 100644
@@ -1543,7 +1543,7 @@ int open_container(int fd)
 	/* 'fd' is a block device.  Find out if it is in use
 	 * by a container, and return an open fd on that container.
 	 */
-	char path[256];
+	char path[288];
 	char *e;
 	DIR *dir;
 	struct dirent *de;
Signature · 1 line
2.7.5
Applied
#1 lore raw
Quoted 8 lines · Xiao Ni

In util.c, there is a building error:
'/md/metadata_version' directive writing 20 bytes into a region of size between 0 and 255 [-Werror=format-overflow=]

In mapfile.c
It declares the fouth argument as 'int *' in map_update, but in mdadm.h it's previously declared as an array 'int[4]'

Quoted 5 lines
---
 mapfile.c | 2 +-
 util.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied!

Thanks,
Jes