summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-04-19 15:28:07 +1000
committerNeilBrown <neilb@suse.de>2010-04-19 15:28:07 +1000
commit4eb269706f403d2424166683688f0a41d893c1c3 (patch)
treeeff7209c10aa9810ba7cbe4eca325357388aab5c /mdadm.h
parentc824e918980e46aa8dba5d806304877444837054 (diff)
downloadmdadm-4eb269706f403d2424166683688f0a41d893c1c3.tar.gz
mdadm-4eb269706f403d2424166683688f0a41d893c1c3.tar.xz
mdadm-4eb269706f403d2424166683688f0a41d893c1c3.zip
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 <krzysztof.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h1
1 files changed, 1 insertions, 0 deletions
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);