diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-02-02 15:01:13 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-02-02 15:01:13 -0700 |
commit | 5a03814040095c0eaf576ce5530ade93a2b558d0 (patch) | |
tree | 841b98c5b0727b0547653422d0035b457d05070c /super-intel.c | |
parent | 78757ce8a57059a09f7ea57fd9a5d47984d98fe9 (diff) | |
download | mdadm-5a03814040095c0eaf576ce5530ade93a2b558d0.tar.gz mdadm-5a03814040095c0eaf576ce5530ade93a2b558d0.tar.xz mdadm-5a03814040095c0eaf576ce5530ade93a2b558d0.zip |
imsm: block creation of devices with identical names
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index caf9a99..f169515 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2175,6 +2175,17 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, */ if (super->current_vol == 0) mpb->num_disks = 0; + + for (i = 0; i < super->current_vol; i++) { + dev = get_imsm_dev(super, i); + if (strncmp((char *) dev->volume, name, + MAX_RAID_SERIAL_LEN) == 0) { + fprintf(stderr, Name": '%s' is already defined for this container\n", + name); + return 0; + } + } + sprintf(st->subarray, "%d", idx); dv = malloc(sizeof(*dv)); if (!dv) { |