master - dlm_controld: join should return error without fence domain
David Teigland
teigland@fedoraproject.org
Wed Nov 5 22:51:00 GMT 2008
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ad0a7afec048ab20c76a56a4fc1ede9f091f5873
Commit: ad0a7afec048ab20c76a56a4fc1ede9f091f5873
Parent: 3a7fcf0a2b0d724d1cd130dbf037f65a48fa65ef
Author: David Teigland <teigland@redhat.com>
AuthorDate: Wed Nov 5 16:30:48 2008 -0600
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Wed Nov 5 16:30:48 2008 -0600
dlm_controld: join should return error without fence domain
If there's no fence domain, and a process tries to join a lockspace,
we should return an error from join_lockspace.
Signed-off-by: David Teigland <teigland@redhat.com>
---
group/dlm_controld/cpg.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 50182e4..90334be 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1482,11 +1482,20 @@ int dlm_join_lockspace(struct lockspace *ls)
cpg_error_t error;
cpg_handle_t h;
struct cpg_name name;
- int i = 0, fd, ci;
+ int i = 0, fd, ci, rv;
+ int unused;
+
+ rv = fence_in_progress(&unused);
+ if (cfgd_enable_fencing && rv < 0) {
+ log_error("dlm_join_lockspace no fence domain");
+ rv = -1;
+ goto fail_free;
+ }
error = cpg_initialize(&h, &cpg_callbacks);
if (error != CPG_OK) {
log_error("cpg_initialize error %d", error);
+ rv = -1;
goto fail_free;
}
@@ -1521,6 +1530,7 @@ int dlm_join_lockspace(struct lockspace *ls)
if (error != CPG_OK) {
log_error("cpg_join error %d", error);
cpg_finalize(h);
+ rv = -1;
goto fail;
}
@@ -1531,8 +1541,9 @@ int dlm_join_lockspace(struct lockspace *ls)
client_dead(ci);
cpg_finalize(h);
fail_free:
+ set_sysfs_event_done(ls->name, rv);
free_ls(ls);
- return error;
+ return rv;
}
/* received an "offline" uevent from dlm-kernel */
More information about the Cluster-cvs
mailing list