summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorLukasz Orlowski <lukasz.orlowski@intel.com>2011-11-07 12:20:34 +1100
committerNeilBrown <neilb@suse.de>2011-11-07 12:20:34 +1100
commit7c3367585ec04e249dca1d6e64afcb2be9723a9b (patch)
treecfcb56337396111fb6cfe62f6fdde590f8fe21da /mdadm.c
parent4584621ab439f009d7f6a3e61b7cc91c0374065f (diff)
fix: Allowed to assemble 2 volumes with the same names from config file.
mdadm allowes to assemble 2 volumes with the same names based on the config file. The issue is fixed by iterating over the list of md device identifiers and comparing the names of md devices against each other, detecting identical names and blocking the assembly should the same names be found. Now having detected duplicate names, mdadm terminates without assembling the container, displaying appropriate prompt. Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index 8e0ce186..c6a887a8 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1292,6 +1292,13 @@ int main(int argc, char *argv[])
struct map_ent *map = NULL;
int cnt = 0;
int failures, successes;
+
+ if (conf_verify_devnames(array_list)) {
+ fprintf(stderr, Name
+ ": Duplicate MD device names in "
+ "conf file were found.\n");
+ exit(1);
+ }
if (devlist == NULL) {
fprintf(stderr, Name ": No devices listed in conf file were found.\n");
exit(1);