mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvconvert: Disallow mixing of cache and thin pools.
--cachepool can't take a thin pool and --thinpool can't take a cache pool.
This commit is contained in:
parent
bdb05cc05e
commit
a2a869afc8
@ -2733,6 +2733,18 @@ static int _lvconvert_pool(struct cmd_context *cmd,
|
||||
if (lv_is_pool(pool_lv)) {
|
||||
lp->pool_data_lv = pool_lv;
|
||||
|
||||
if (arg_is_set(cmd, cachepool_ARG) && lv_is_thin_pool(pool_lv)) {
|
||||
log_error("--cachepool requires a cache pool. %s is a thin pool.",
|
||||
display_lvname(pool_lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg_is_set(cmd, thinpool_ARG) && lv_is_cache_pool(pool_lv)) {
|
||||
log_error("--thinpool requires a thin pool. %s is a cache pool.",
|
||||
display_lvname(pool_lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!metadata_lv) {
|
||||
if (arg_from_list_is_set(cmd, "is invalid with existing pool",
|
||||
cachemode_ARG,chunksize_ARG, discards_ARG,
|
||||
|
Loading…
Reference in New Issue
Block a user