|
|
15862b |
From 30ac299da6a01a2f5f42fac6b3d35275ddc001e7 Mon Sep 17 00:00:00 2001
|
|
|
15862b |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
15862b |
Date: Mon, 29 May 2017 14:38:48 +0200
|
|
|
15862b |
Subject: [PATCH] LVM: warn when cache mode is not writethrough
|
|
|
15862b |
|
|
|
15862b |
---
|
|
|
15862b |
heartbeat/LVM | 17 ++---------------
|
|
|
15862b |
1 file changed, 2 insertions(+), 15 deletions(-)
|
|
|
15862b |
|
|
|
15862b |
diff --git a/heartbeat/LVM b/heartbeat/LVM
|
|
|
15862b |
index 583b9a2bd..7ebedac6f 100755
|
|
|
15862b |
--- a/heartbeat/LVM
|
|
|
15862b |
+++ b/heartbeat/LVM
|
|
|
15862b |
@@ -29,8 +29,6 @@
|
|
|
15862b |
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
|
|
|
15862b |
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
|
|
|
15862b |
|
|
|
15862b |
-OCF_RESKEY_check_writethrough_default="false"
|
|
|
15862b |
-
|
|
|
15862b |
#######################################################################
|
|
|
15862b |
|
|
|
15862b |
|
|
|
15862b |
@@ -108,14 +106,6 @@ logical volumes.
|
|
|
15862b |
<content type="string" default="false" />
|
|
|
15862b |
</parameter>
|
|
|
15862b |
|
|
|
15862b |
-<parameter name="check_writethrough" unique="0" required="0">
|
|
|
15862b |
-<longdesc lang="en">
|
|
|
15862b |
-If set to true, check if cache_mode is set to writethrough.
|
|
|
15862b |
-</longdesc>
|
|
|
15862b |
-<shortdesc lang="en">Check if cache_mode is set to writethrough</shortdesc>
|
|
|
15862b |
-<content type="string" default="${OCF_RESKEY_check_writethrough_default}" />
|
|
|
15862b |
-</parameter>
|
|
|
15862b |
-
|
|
|
15862b |
</parameters>
|
|
|
15862b |
|
|
|
15862b |
<actions>
|
|
|
15862b |
@@ -593,10 +583,9 @@ LVM_validate_all() {
|
|
|
15862b |
exit $OCF_ERR_GENERIC
|
|
|
15862b |
fi
|
|
|
15862b |
|
|
|
15862b |
- if ocf_is_true "$OCF_RESKEY_check_writethrough"; then
|
|
|
15862b |
+ if lvs --noheadings -o segtype | grep -q "cache"; then
|
|
|
15862b |
if ! lvs --noheadings -o cache_mode "$OCF_RESKEY_volgrpname" | grep -q "writethrough"; then
|
|
|
15862b |
- ocf_exit_reason "LVM cache is not in writethrough mode."
|
|
|
15862b |
- exit $OCF_ERR_CONFIGURED
|
|
|
15862b |
+ ocf_log warn "LVM CACHE IS NOT IN WRITETHROUGH MODE. THIS IS NOT A SUPPORTED CONFIGURATION."
|
|
|
15862b |
fi
|
|
|
15862b |
fi
|
|
|
15862b |
|
|
|
15862b |
@@ -707,8 +696,6 @@ if [ -n "$OCF_RESKEY_tag" ]; then
|
|
|
15862b |
OUR_TAG=$OCF_RESKEY_tag
|
|
|
15862b |
fi
|
|
|
15862b |
|
|
|
15862b |
-: ${OCF_RESKEY_check_writethrough=${OCF_RESKEY_check_writethrough_default}}
|
|
|
15862b |
-
|
|
|
15862b |
# What kind of method was invoked?
|
|
|
15862b |
case "$1" in
|
|
|
15862b |
|