Skip to contentSkip to conversation

master - vdo: make vdopool wrapping device is read-only

PATCH Zdenek Kabelac 1 participant 1 message Mar 25, 2020

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=caff31df192bc4b06c8b0e9c75cbe93ff79581a5
Commit:        caff31df192bc4b06c8b0e9c75cbe93ff79581a5
Parent:        e6b93dc24e293bb06403f914ed5c03f9afa1a8ee
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Mar 11 12:57:44 2020 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Mar 23 17:13:26 2020 +0100

vdo: make vdopool wrapping device is read-only

When vdopool is activated standalone - we use a wrapping linear device to hold actual vdo device active - for this we can set-up read-only device to ensure there cannot be made write through this device to actual pool device.

---
 lib/activate/dev_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/activate/dev_manager.c +1 -1
index 3b991319f..75d4df0e6 100644
@@ -86,7 +86,7 @@ int read_only_lv(const struct logical_volume *lv, const struct lv_activate_opts
 		return 0; /* Keep RAID SubLvs writable */
 
 	if (!layer) {
-		if (lv_is_thin_pool(lv))
+		if (lv_is_thin_pool(lv) || lv_is_vdo_pool(lv))
 			return 1;
 	}