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

lvmlockd: enable creation of cache pool with lvcreate

Previously, cache pools needed to be created with lvconvert.
This commit is contained in:
David Teigland 2018-05-25 13:26:16 -05:00
parent 948f2d9979
commit 403c87c1aa
2 changed files with 12 additions and 7 deletions

View File

@ -2416,10 +2416,6 @@ int lockd_init_lv_args(struct cmd_context *cmd, struct volume_group *vg,
* an LV with no lock_args will do nothing (unless the LV type causes the lock
* request to be directed to another LV with a lock, e.g. to the thin pool LV
* for thin LVs.)
*
* Current limitations:
* - cache-type LV's in a lockd VG must be created with lvconvert.
* - creating a thin pool and thin lv in one command is not allowed.
*/
int lockd_init_lv(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv,
@ -2448,7 +2444,17 @@ int lockd_init_lv(struct cmd_context *cmd, struct volume_group *vg, struct logic
/* needs_lock_init is set for LVs that need a lockd lock. */
return 1;
} else if (seg_is_cache(lp) || seg_is_cache_pool(lp)) {
} else if (seg_is_cache_pool(lp)) {
/*
* A cache pool does not use a lockd lock because it cannot be
* used by itself. When a cache pool is attached to an actual
* LV, the lockd lock for that LV covers the LV and the cache
* pool attached to it.
*/
lv->lock_args = NULL;
return 1;
} else if (seg_is_cache(lp)) {
/*
* This should not happen because the command defs are
* checked and excluded for shared VGs early in lvcreate.

View File

@ -1638,8 +1638,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
lp->snapshot ? lp->origin_name : "", lp->segtype->name);
if (is_lockd_type(vg->lock_type)) {
if (cmd->command->command_enum == lvcreate_cachepool_CMD ||
cmd->command->command_enum == lvcreate_cache_vol_with_new_origin_CMD ||
if (cmd->command->command_enum == lvcreate_cache_vol_with_new_origin_CMD ||
cmd->command->command_enum == lvcreate_thin_vol_with_thinpool_or_sparse_snapshot_CMD ||
cmd->command->command_enum == lvcreate_cache_vol_with_new_origin_or_convert_to_cache_vol_with_cachepool_CMD) {
log_error("Use lvconvert to create thin pools and cache pools in a shared VG.");