Skip to contentSkip to conversation

master - vgexport: do not allow lockd VG to be exported

PATCH David Teigland 1 participant 1 message Jul 10, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c39f3026a8280bb4c62c785138302cd1475facb6
Commit:        c39f3026a8280bb4c62c785138302cd1475facb6
Parent:        222bb2b88d06a67cc25ed19332919fa339d7e831
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Jul 10 13:49:51 2015 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Jul 10 15:53:21 2015 -0500

vgexport: do not allow lockd VG to be exported

vgexport and vgimport have no use for a shared VG.

---
 tools/vgexport.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
tools/vgexport.c +7 -0
index 6d5b4f6..7e90e5c 100644
@@ -22,6 +22,13 @@ static int vgexport_single(struct cmd_context *cmd __attribute__((unused)),
 {
 	struct pv_list *pvl;
 
+	/* vgexport/vgimport have to use with shared VGs. */
+	if (is_lockd_type(vg->lock_type)) {
+		log_error("Volume group \"%s\" has lock_type %s that cannot be exported",
+			  vg_name, vg->lock_type);
+		goto bad;
+	}
+
 	if (lvs_in_vg_activated(vg)) {
 		log_error("Volume group \"%s\" has active logical volumes",
 			  vg_name);