diff options
author | Goldwyn Rodrigues <rgoldwyn@suse.de> | 2014-01-21 18:48:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:41 -0500 |
commit | c74a3bdd9b529d924d1abf986079b783dd105ace (patch) | |
tree | 5825198c12a9151ea403afae6b6822836b5f59b0 /fs/ocfs2/super.c | |
parent | ff8fb335221e2c446b0d4cbea26be371fd2feb64 (diff) |
ocfs2: add clustername to cluster connection
This is an effort of removing ocfs2_controld.pcmk and getting ocfs2 DLM
handling up to the times with respect to DLM (>=4.0.1) and corosync
(2.3.x). AFAIK, cman also is being phased out for a unified corosync
cluster stack.
fs/dlm performs all the functions with respect to fencing and node
management and provides the API's to do so for ocfs2. For all future
references, DLM stands for fs/dlm code.
The advantages are:
+ No need to run an additional userspace daemon (ocfs2_controld)
+ No controld device handling and controld protocol
+ Shifting responsibilities of node management to DLM layer
For backward compatibility, we are keeping the controld handling code.
Once enough time has passed we can remove a significant portion of the
code. This was tested by using the kernel with changes on older
unmodified tools. The kernel used ocfs2_controld as expected, and
displayed the appropriate warning message.
This feature requires modification in the userspace ocfs2-tools. The
changes can be found at: https://github.com/goldwynr/ocfs2-tools branch:
nocontrold Currently, not many checks are present in the userspace code,
but that would change soon.
This patch (of 6):
Add clustername to cluster connection.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index fcd595e5d2c7..5445d72eb8e5 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -2223,10 +2223,9 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
2223 | if (ocfs2_clusterinfo_valid(osb)) { | 2223 | if (ocfs2_clusterinfo_valid(osb)) { |
2224 | osb->osb_stackflags = | 2224 | osb->osb_stackflags = |
2225 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags; | 2225 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags; |
2226 | memcpy(osb->osb_cluster_stack, | 2226 | strlcpy(osb->osb_cluster_stack, |
2227 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stack, | 2227 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stack, |
2228 | OCFS2_STACK_LABEL_LEN); | 2228 | OCFS2_STACK_LABEL_LEN + 1); |
2229 | osb->osb_cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; | ||
2230 | if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) { | 2229 | if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) { |
2231 | mlog(ML_ERROR, | 2230 | mlog(ML_ERROR, |
2232 | "couldn't mount because of an invalid " | 2231 | "couldn't mount because of an invalid " |
@@ -2235,6 +2234,9 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
2235 | status = -EINVAL; | 2234 | status = -EINVAL; |
2236 | goto bail; | 2235 | goto bail; |
2237 | } | 2236 | } |
2237 | strlcpy(osb->osb_cluster_name, | ||
2238 | OCFS2_RAW_SB(di)->s_cluster_info.ci_cluster, | ||
2239 | OCFS2_CLUSTER_NAME_LEN + 1); | ||
2238 | } else { | 2240 | } else { |
2239 | /* The empty string is identical with classic tools that | 2241 | /* The empty string is identical with classic tools that |
2240 | * don't know about s_cluster_info. */ | 2242 | * don't know about s_cluster_info. */ |