Skip to contentSkip to conversation

master - vdo: size reduction requires VDO to be active

PATCH Zdenek Kabelac 1 participant 1 message Jan 21, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bd6709cec6ca9ecc2c5f4e5f7d587daee5bd8cd1
Commit:        bd6709cec6ca9ecc2c5f4e5f7d587daee5bd8cd1
Parent:        f1ad4b067962c36e6f8199a8c6d10496bd9fb3b7
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Jan 19 19:32:02 2019 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Jan 21 12:53:16 2019 +0100

vdo: size reduction requires VDO to be active

To be able to send discard to reduced areas - the VDO LV needs to be active.

---
 lib/metadata/lv_manip.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
lib/metadata/lv_manip.c +5 -0
index 1825abe..5418535 100644
@@ -4663,6 +4663,11 @@ static int _request_confirmation(const struct logical_volume *lv,
 			return 0;
 		}
 		return 1;
+	} else if (lv_is_vdo(lv) && !info.exists) {
+		log_error("Logical volume %s must be activated "
+			  "before reducing device size.",
+			  display_lvname(lv));
+		return 0;
 	}
 
 	if (!info.exists)