summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2023-03-17 16:39:48 -0500
committerDavid Teigland <teigland@redhat.com>2023-04-05 14:24:07 -0500
commit390ff5be2fd9dda47f2bfd2db96de64acc925002 (patch)
treefe69ed734cd6921469be34be23dfbf8a3cdc49cf /lib
parentebbc3f7ab31e8026499bddd93cde4db4921d2132 (diff)
downloadlvm2-390ff5be2fd9dda47f2bfd2db96de64acc925002.tar.gz
raidintegrity: allow writecache and cache
Allow writecache|cache over raid+integrity LV.
Diffstat (limited to 'lib')
-rw-r--r--lib/metadata/snapshot_manip.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c
index 99eb9c30d..822b8da77 100644
--- a/lib/metadata/snapshot_manip.c
+++ b/lib/metadata/snapshot_manip.c
@@ -391,6 +391,14 @@ int validate_snapshot_origin(const struct logical_volume *origin_lv)
{
const char *err = NULL; /* For error string */
+ if (lv_is_cache(origin_lv) || lv_is_writecache(origin_lv)) {
+ struct logical_volume *lv = seg_lv(first_seg(origin_lv), 0);
+ if (lv_is_raid(lv) && lv_raid_has_integrity(lv)) {
+ err = "raid with integrity";
+ goto out;
+ }
+ }
+
if (lv_is_cow(origin_lv))
err = "snapshots";
else if (lv_is_locked(origin_lv))
@@ -419,6 +427,7 @@ int validate_snapshot_origin(const struct logical_volume *origin_lv)
err = "raid with integrity";
}
+ out:
if (err) {
log_error("Snapshots of %s are not supported.", err);
return 0;