1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix for bug 614164: No check for existing name when splitting mirror

The user could use the same name as an existing LV when specifying a
name for an LV split off from a mirror.  This causes all sorts of
issues.
This commit is contained in:
Jonathan Earl Brassow 2010-07-13 22:24:39 +00:00
parent 48c245884e
commit 60f425d1b3
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.71 -
===============================
Check if LV with specified name already exists when splitting a mirror.
Fix suspend/resume logic for LVs resulting from splitting a mirror.
Switch cmirrord and clvmd to use dm_create_lockfile.
Allow clvmd pidfile to be configurable.

View File

@ -1982,6 +1982,12 @@ int lv_split_mirror_images(struct logical_volume *lv, const char *split_name,
{
int r;
if (find_lv_in_vg(lv->vg, split_name)) {
log_error("Logical Volume \"%s\" already exists in "
"volume group \"%s\"", split_name, lv->vg->name);
return 0;
}
/* Can't split a mirror that is not in-sync... unless force? */
if (!_mirrored_lv_in_sync(lv)) {
log_error("Unable to split mirror that is not in-sync.");