Skip to contentSkip to conversation

main - raidintegrity: allow snapshots

PATCH David Teigland 1 participant 1 message May 11, 2023

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fd6e113bba5fed5ee41152cde33220294c24ce2b
Commit:        fd6e113bba5fed5ee41152cde33220294c24ce2b
Parent:        05c2b10c5d0a99993430ffbcef684a099ba810ad
Author:        David Teigland <[email protected]>
AuthorDate:    Wed Mar 22 13:05:43 2023 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Thu May 11 11:02:52 2023 -0500

raidintegrity: allow snapshots

---
 lib/activate/dev_manager.c     |   6 +-
 lib/metadata/integrity_manip.c |   5 -
 lib/metadata/snapshot_manip.c  |   2 -
 test/shell/snapshot-raid.sh    | 441 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 446 insertions(+), 8 deletions(-)
lib/activate/dev_manager.c +5 -1
index ac3f01718..1f4d7c98b 100644
@@ -3039,7 +3039,11 @@ int add_areas_line(struct dev_manager *dm, struct lv_segment *seg,
 		if (((seg_type(seg, s) == AREA_PV) && _bad_pv_area(seg, s)) ||
 		    ((seg_type(seg, s) == AREA_LV) && !seg_lv(seg, s))) {
 			if (!cmd->partial_activation) {
-				if (!cmd->degraded_activation || !lv_is_raid_type(seg->lv)) {
+				if (!cmd->degraded_activation ||
+				    (!lv_is_raid_type(seg->lv) &&
+				     !lv_is_integrity(seg->lv) &&
+				     !lv_is_integrity_metadata(seg->lv) &&
+				     !lv_is_integrity_origin(seg->lv))) {
 					log_error("Aborting.  LV %s is incomplete and --activationmode partial was not specified.",
 						  display_lvname(seg->lv));
 					return 0;
lib/metadata/integrity_manip.c +0 -5
index d71fbaeb6..6b507f7e9 100644
@@ -508,11 +508,6 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, struct integrity_setting
 		return 0;
 	}
 
-	if (lv_is_origin(lv)) {
-		log_error("Integrity cannot be added to snapshot origins.");
-		return 0;
-	}
-
 	seg_top = first_seg(lv);
 	area_count = seg_top->area_count;
 
lib/metadata/snapshot_manip.c +0 -2
index 822b8da77..b34079d08 100644
@@ -423,8 +423,6 @@ int validate_snapshot_origin(const struct logical_volume *origin_lv)
 		}
 	} else if (lv_is_raid_type(origin_lv) && !lv_is_raid(origin_lv)) {
 		err = "raid subvolumes";
-	} else if (lv_is_raid(origin_lv) && lv_raid_has_integrity((struct logical_volume *)origin_lv)) {
-		err = "raid with integrity";
 	}
 
  out:
test/shell/snapshot-raid.sh new file +441 -0

441 lines not on this page · raw message