Blame SOURCES/bz1392432-LVM-partial_activation-fix.patch

15862b
From 42d298191993fd8d851a881a067e09aca2d4a079 Mon Sep 17 00:00:00 2001
15862b
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
15862b
Date: Fri, 27 Jan 2017 10:25:18 +0100
15862b
Subject: [PATCH] LVM: fix partial activation
15862b
15862b
---
15862b
 heartbeat/LVM | 6 ++++--
15862b
 1 file changed, 4 insertions(+), 2 deletions(-)
15862b
15862b
diff --git a/heartbeat/LVM b/heartbeat/LVM
15862b
index 79c2791..90a900b 100755
15862b
--- a/heartbeat/LVM
15862b
+++ b/heartbeat/LVM
15862b
@@ -548,7 +548,8 @@ LVM_validate_all() {
15862b
 		# "unknown device" then another node may have marked a device missing 
15862b
 		# where we have access to all of them and can start without issue. 
15862b
 		if vgs -o pv_attr --noheadings $OCF_RESKEY_volgrpname 2>/dev/null | grep 'm' > /dev/null 2>&1; then
15862b
-			if vgs -o pv_name --noheadings $OCF_RESKEY_volgrpname 2>/dev/null | grep 'unknown device' > /dev/null 2>&1; then
15862b
+			case $(vgs -o attr --noheadings $OCF_RESKEY_volgrpname | tr -d ' ') in
15862b
+			???p??*)
15862b
 				if ! ocf_is_true "$OCF_RESKEY_partial_activation" ; then
15862b
 					# We are missing devices and cannot activate partially
15862b
 					ocf_exit_reason "Volume group [$VOLUME] has devices missing.  Consider partial_activation=true to attempt to activate partially"
15862b
@@ -558,7 +559,8 @@ LVM_validate_all() {
15862b
 					# Assume that caused the vgck failure and carry on
15862b
 					ocf_log warn "Volume group inconsistency detected with missing device(s) and partial_activation enabled.  Proceeding with requested action."
15862b
 				fi
15862b
-			fi
15862b
+				;;
15862b
+			esac
15862b
 			# else the vg is partial but all devices are accounted for, so another 
15862b
 			# node must have marked the device missing.  Proceed.
15862b
 		else