mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_03_09-writecache-check-if-cachevol-is-writable.patch

22b171
 tools/lvconvert.c | 5 +++++
22b171
 1 file changed, 5 insertions(+)
22b171
22b171
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
22b171
index cd9a3e8..aa2dca7 100644
22b171
--- a/tools/lvconvert.c
22b171
+++ b/tools/lvconvert.c
22b171
@@ -5351,6 +5351,11 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
22b171
 	};
22b171
 	int ret;
22b171
 
22b171
+	if (!(lv->status & LVM_WRITE)) {
22b171
+		log_error("Cannot initialize readonly LV %s", display_lvname(lv));
22b171
+		return 0;
22b171
+	}
22b171
+
22b171
 	if (test_mode())
22b171
 		return 1;
22b171