mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-28 02:50:41 +03:00
lvconvert: reject conversions of LVs under snapshot
Conversions of LVs under snapshot to thinpool or cachepool correctly fail but leave them inactive and provide cryptic error messages like 'Internal error: #LVs (10) != #visible LVs (2) + #snapshots (1) + #internal LVs (5) in VG VG'. Reject and provide better error message. Resolves: rhbz1514146
This commit is contained in:
parent
778ce8d808
commit
2214dc12c3
@ -4235,6 +4235,12 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd,
|
||||
return 0;
|
||||
};
|
||||
|
||||
if (lv_is_origin(lv)) {
|
||||
log_error("Cannot convert logical volume %s under snapshot.",
|
||||
display_lvname(lv));
|
||||
return 0;
|
||||
};
|
||||
|
||||
if (cmd->position_argc > 1) {
|
||||
/* First pos arg is required LV, remaining are optional PVs. */
|
||||
if (!(use_pvh = create_pv_list(cmd->mem, lv->vg, cmd->position_argc - 1, cmd->position_argv + 1, 0)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user