From 35b4f310dedd95c5e24b1473b73de194a3fe3f3e Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Thu, 1 Jun 2017 14:26:10 +0200
Subject: [PATCH] Fix: sbd-inquisitor: Do not create duplicate servants
---
src/sbd-inquisitor.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
index cd7d914..b82e6e8 100644
--- a/src/sbd-inquisitor.c
+++ b/src/sbd-inquisitor.c
@@ -50,6 +50,11 @@ void recruit_servant(const char *devname, pid_t pid)
struct servants_list_item *s = servants_leader;
struct servants_list_item *newbie;
+ if (lookup_servant_by_dev(devname)) {
+ cl_log(LOG_DEBUG, "Servant %s already exists", devname);
+ return;
+ }
+
newbie = malloc(sizeof(*newbie));
if (!newbie) {
fprintf(stderr, "malloc failed in recruit_servant.\n");
--
1.8.3.1