File bsc#1117381-0001-High-crmd-delete-resource-from-lrmd-when-appropriate.patch of Package pacemaker.14737

From c6c18f59ad008b88684838637cbb699abc22c08a Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 9 Apr 2018 15:20:01 -0500
Subject: [PATCH] High: crmd: delete resource from lrmd when appropriate

Regression introduced in e8802834 (2.0.0-rc2): a missing return value check
meant that crmd would always delete resource from its LRM state only, and
not from the lrmd itself. As a side effect, this also introduced a memory leak
when deleting a resource.
---
 crmd/lrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crmd/lrm.c b/crmd/lrm.c
index c92142616..dca94df06 100644
--- a/crmd/lrm.c
+++ b/crmd/lrm.c
@@ -1837,7 +1837,7 @@ do_lrm_invoke(long long action,
                                     PCMK_OCF_CONNECTION_DIED);
             return;
 
-        } else if (!create_rsc) {
+        } else if ((rc < 0) && !create_rsc) {
             /* Delete of malformed or nonexistent resource
              * (deleting something that does not exist is a success)
              */
-- 
2.16.4

openSUSE Build Service is sponsored by