Version 2.02.169 -
=====================================
+ Enable usage of cached volumes as snapshot origin LV.
Fix displayed lv name when splitting snapshot (2.02.146).
Warn about command not making metadata backup just once per command.
Enable usage of cached volume as thin volume's external origin.
if (lv_is_cache_type(origin_lv) ||
lv_is_mirror_type(origin_lv) ||
lv_is_thin_volume(origin_lv) || lv_is_thin_pool_metadata(origin_lv) ||
- lv_is_origin(origin_lv) || lv_is_merging_origin(origin_lv) ||
+ lv_is_merging_origin(origin_lv) ||
lv_is_cow(origin_lv) || lv_is_merging_cow(origin_lv) ||
lv_is_virtual(origin_lv)) {
log_error("Cache is not supported with %s segment type of the original logical volume %s.",
return NULL;
}
- if (lv_is_cache_type(origin_lv)) {
+ if (lv_is_cache_type(origin_lv) && !lv_is_cache(origin_lv)) {
log_error("Snapshots of cache type volume %s "
"is not supported.", display_lvname(origin_lv));
return NULL;
return_0;
if (lv_is_locked(org) ||
- lv_is_cache_type(org) ||
+ (lv_is_cache_type(org) && !lv_is_cache(org)) ||
lv_is_thin_type(org) ||
lv_is_pvmove(org) ||
lv_is_mirrored(org) ||
return 1;
}
+/*
+ * Convert/Recombine cacheLV to be an origin for snapshot
+ * lvconvert --type snapshot cacheLV snapshotLV
+ */
+static int _convert_cache_volume_snapshot(struct cmd_context *cmd, struct logical_volume *lv,
+ struct lvconvert_params *lp)
+{
+ return _lvconvert_snapshot(cmd, lv, lp);
+}
+
/*
* Split a cache volume from a cache pool LV.
* lvconvert --splitcache LV
arg_is_set(cmd, thinpool_ARG))
return _convert_cache_volume_thin_pool(cmd, lv, lp);
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_SNAPSHOT) ||
+ arg_is_set(cmd, snapshot_ARG))
+ return _convert_cache_volume_snapshot(cmd, lv, lp);
+
/* The --thinpool alternative for --type thin-pool is not preferred, so not shown. */
log_error("Operation not permitted on cache LV %s.", display_lvname(lv));