Skip to contentSkip to conversation

master - dev_manager: always activate RAID SubLVs readwrite

PATCH Heinz Mauelshagen 1 participant 1 message Mar 12, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0646fd465eef51f3cfbd2219a0992af27d61ae14
Commit:        0646fd465eef51f3cfbd2219a0992af27d61ae14
Parent:        dd88a0f05cb27d54aa74960bbe9370fa37197cdc
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Mon Mar 12 22:21:13 2018 +0100
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Mon Mar 12 22:29:54 2018 +0100

dev_manager: always activate RAID SubLVs readwrite

RaidLVs on read_only_volume_list have their SubLVs activated readonly thus disabling metadata updates or image resynchronization/recovery. Bug also causes automatic repairs to fail.

Fix by always activating the RAID SubLVs readwrite.

Resolves: rhbz1208269

---
 WHATS_NEW                  |    1 +
 lib/activate/dev_manager.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index 40f81f5..177a2fe 100644
@@ -1,5 +1,6 @@
 Version 2.02.178 - 
 =====================================
+  Activate RAID SubLVs on read_only_volume_list readwrite
   Offer convenience type raid5_n converting to raid10
   Automatically avoid reading invalid snapshots during device scan.
   Ensure COW device is writable even for read-only thick snapshots.
lib/activate/dev_manager.c +3 -0
index 6b042fb..f4d602f 100644
@@ -80,6 +80,9 @@ int read_only_lv(const struct logical_volume *lv, const struct lv_activate_opts
 	if (layer && lv_is_cow(lv))
 		return 0; /* Keep snapshot's COW volume writable */
 
+	if (lv_is_raid_image(lv) || lv_is_raid_metadata(lv))
+		return 0; /* Keep RAID SubLvs writable */
+
 	return (laopts->read_only || !(lv->status & LVM_WRITE));
 }