]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/super.c
ocfs2: add clustername to cluster connection
[~andy/linux] / fs / ocfs2 / super.c
index d4e81e4a9b0489de2eb66899eb23b9d87ea81ae5..5445d72eb8e524162c906af308208b81dbadc291 100644 (file)
@@ -68,7 +68,6 @@
 #include "super.h"
 #include "sysfile.h"
 #include "uptodate.h"
-#include "ver.h"
 #include "xattr.h"
 #include "quota.h"
 #include "refcounttree.h"
@@ -90,6 +89,7 @@ static struct dentry *ocfs2_debugfs_root = NULL;
 
 MODULE_AUTHOR("Oracle");
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("OCFS2 cluster file system");
 
 struct mount_options
 {
@@ -1618,8 +1618,6 @@ static int __init ocfs2_init(void)
 {
        int status, i;
 
-       ocfs2_print_version();
-
        for (i = 0; i < OCFS2_IOEND_WQ_HASH_SZ; i++)
                init_waitqueue_head(&ocfs2__ioend_wq[i]);
 
@@ -1848,8 +1846,8 @@ static int ocfs2_get_sector(struct super_block *sb,
 
        *bh = sb_getblk(sb, block);
        if (!*bh) {
-               mlog_errno(-EIO);
-               return -EIO;
+               mlog_errno(-ENOMEM);
+               return -ENOMEM;
        }
        lock_buffer(*bh);
        if (!buffer_dirty(*bh))
@@ -2225,10 +2223,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
        if (ocfs2_clusterinfo_valid(osb)) {
                osb->osb_stackflags =
                        OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags;
-               memcpy(osb->osb_cluster_stack,
+               strlcpy(osb->osb_cluster_stack,
                       OCFS2_RAW_SB(di)->s_cluster_info.ci_stack,
-                      OCFS2_STACK_LABEL_LEN);
-               osb->osb_cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
+                      OCFS2_STACK_LABEL_LEN + 1);
                if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) {
                        mlog(ML_ERROR,
                             "couldn't mount because of an invalid "
@@ -2237,6 +2234,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
                        status = -EINVAL;
                        goto bail;
                }
+               strlcpy(osb->osb_cluster_name,
+                       OCFS2_RAW_SB(di)->s_cluster_info.ci_cluster,
+                       OCFS2_CLUSTER_NAME_LEN + 1);
        } else {
                /* The empty string is identical with classic tools that
                 * don't know about s_cluster_info. */