diff options
author | NeilBrown <neilb@suse.de> | 2010-12-01 09:55:35 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-03-10 17:20:25 +1100 |
commit | 002a3de3d4a05692e9951cc3aba9fec5fb937623 (patch) | |
tree | 94fe9c1635c90387a17befa1963d80ed6562f3c4 /super-ddf.c | |
parent | e42eb35545652f0031436e3df20651ca5889f218 (diff) |
ddf: fail creation of new subarray with same name as old.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r-- | super-ddf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/super-ddf.c b/super-ddf.c index 141731a3..d06c8058 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1960,6 +1960,19 @@ static int init_super_ddf_bvd(struct supertype *st, return 0; } + if (name) + for (venum = 0; venum < __be16_to_cpu(ddf->virt->max_vdes); venum++) + if (!all_ff(ddf->virt->entries[venum].guid)) { + char *n = ddf->virt->entries[venum].name; + + if (strncmp(name, n, 16) == 0) { + fprintf(stderr, Name ": This ddf already" + " has an array called %s\n", + name); + return 0; + } + } + for (venum = 0; venum < __be16_to_cpu(ddf->virt->max_vdes); venum++) if (all_ff(ddf->virt->entries[venum].guid)) break; |