From 4eb269706f403d2424166683688f0a41d893c1c3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 19 Apr 2010 15:28:07 +1000 Subject: Create: cleanup after failed create in duplicated array member case mdadm prevents creation when device names are duplicated on the command line, but leaves the partially created array intact. Detect this case in the error code from add_to_super() and cleanup the partially created array. The imsm handler is updated to report this conflict in add_to_super_imsm_volume(). Note that since neither mdmon, nor userspace for that matter, ever saw an active array we only need to perform a subset of the cleanup actions. So call ioctl(STOP_ARRAY) directly and arrange for Create() to cleanup the map file rather than calling Manage_runstop(). Reported-by: Krzysztof Wojcik Signed-off-by: Dan Williams --- mdadm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index 0386129..1bf5ac0 100644 --- a/mdadm.h +++ b/mdadm.h @@ -372,6 +372,7 @@ struct map_ent { }; extern int map_update(struct map_ent **mpp, int devnum, char *metadata, int uuid[4], char *path); +extern void map_remove(struct map_ent **map, int devnum); extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]); extern struct map_ent *map_by_devnum(struct map_ent **map, int devnum); extern struct map_ent *map_by_name(struct map_ent **map, char *name); -- cgit