forked from pool/ocfs2-tools
45 lines
1.2 KiB
Diff
45 lines
1.2 KiB
Diff
|
From 8563d603b7af2a32ef1e19337eaeb9d7cace730c Mon Sep 17 00:00:00 2001
|
||
|
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||
|
Date: Mon, 19 Aug 2013 19:18:40 -0500
|
||
|
Subject: [PATCH 5/7] Check for DLM kernel version in user_begin_group_join
|
||
|
|
||
|
Since we just have to check if the DLM daemon is running, we
|
||
|
just check the kernel version running. Checking the kernel version
|
||
|
ensures that the dlm daemon is running.
|
||
|
---
|
||
|
libo2cb/o2cb_abi.c | 11 +++++++++++
|
||
|
1 file changed, 11 insertions(+)
|
||
|
|
||
|
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
|
||
|
index d00dd46..26ed848 100644
|
||
|
--- a/libo2cb/o2cb_abi.c
|
||
|
+++ b/libo2cb/o2cb_abi.c
|
||
|
@@ -38,6 +38,7 @@
|
||
|
|
||
|
#include <linux/types.h>
|
||
|
#include <corosync/cmap.h>
|
||
|
+#include <libdlm.h>
|
||
|
|
||
|
#include "o2cb/o2cb.h"
|
||
|
#include "o2cb/o2cb_client_proto.h"
|
||
|
@@ -1350,6 +1351,16 @@ static errcode_t classic_complete_group_join(struct o2cb_cluster_desc *cluster,
|
||
|
static errcode_t user_begin_group_join(struct o2cb_cluster_desc *cluster,
|
||
|
struct o2cb_region_desc *region)
|
||
|
{
|
||
|
+ uint32_t maj, min, pat;
|
||
|
+ int rv;
|
||
|
+
|
||
|
+ rv = dlm_kernel_version(&maj, &min, &pat);
|
||
|
+
|
||
|
+ if (rv < 0)
|
||
|
+ return O2CB_ET_SERVICE_UNAVAILABLE;
|
||
|
+
|
||
|
+ if (maj < 6)
|
||
|
+ return O2CB_ET_INTERNAL_FAILURE;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
--
|
||
|
1.8.1.4
|
||
|
|