Skip to contentSkip to conversation

master - thin: disable conversion of thin-pool to read-only

PATCH Zdenek Kabelac 1 participant 1 message Oct 15, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b3899056d94d14eaa80c49e4a5a52c8e7865f08a
Commit:        b3899056d94d14eaa80c49e4a5a52c8e7865f08a
Parent:        faa9a520857ecae31ab6e8f880a040e1e1b5363a
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 15 13:41:38 2012 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 15 14:09:11 2012 +0200

thin: disable conversion of thin-pool to read-only

This change is not yet supported.

---
 WHATS_NEW        |    1 +
 tools/lvchange.c |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index 53f3fe9..b2b7c35 100644
@@ -1,5 +1,6 @@
 Version 2.02.98 -
 =================================
+  Prohibit not yet supported change of thin-pool to read-only.
   Support creation of read-only thin volumes (lvcreate -p r).
   Using autoextend percent 0 for thin pool fails 'lvextend --use-policies'.
   Introduce blkdeactivate script.
tools/lvchange.c +6 -0
index b787672..85253ef 100644
@@ -51,6 +51,12 @@ static int lvchange_permission(struct cmd_context *cmd,
 		return 0;
 	}
 
+	if (!(lv_access & LVM_WRITE) && lv_is_thin_pool(lv)) {
+		log_error("Change permissions of thin pool \"%s\" not "
+			  "yes supported.", lv->name);
+		return 0;
+	}
+
 	if (lv_access & LVM_WRITE) {
 		lv->status |= LVM_WRITE;
 		log_verbose("Setting logical volume \"%s\" read/write",