Whamcloud - gitweb
LU-5396 lod: (and mdt, mgs) make some symbols static
[fs/lustre-release.git] / lustre / mgs / mgs_llog.c
index 64be40c..85a42a9 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -1442,10 +1442,12 @@ out_end:
 }
 
 /* write the lcfg in all logs for the given fs */
-int mgs_write_log_direct_all(const struct lu_env *env, struct mgs_device *mgs,
-                            struct fs_db *fsdb, struct mgs_target_info *mti,
-                            struct llog_cfg_rec *lcr, char *devname,
-                            char *comment, int server_only)
+static int mgs_write_log_direct_all(const struct lu_env *env,
+                                   struct mgs_device *mgs,
+                                   struct fs_db *fsdb,
+                                   struct mgs_target_info *mti,
+                                   struct llog_cfg_rec *lcr, char *devname,
+                                   char *comment, int server_only)
 {
        struct list_head         log_list;
        struct mgs_direntry     *dirent, *n;
@@ -1469,7 +1471,9 @@ int mgs_write_log_direct_all(const struct lu_env *env, struct mgs_device *mgs,
                if (server_only && strstr(dirent->mde_name, "-client") != NULL)
                        goto next;
 
-               if (strncmp(fsname, dirent->mde_name, len) != 0)
+               if (strlen(dirent->mde_name) <= len ||
+                   strncmp(fsname, dirent->mde_name, len) != 0 ||
+                   dirent->mde_name[len] != '-')
                        goto next;
 
                CDEBUG(D_MGS, "Changing log %s\n", dirent->mde_name);
@@ -3972,7 +3976,7 @@ out:
 
 int mgs_nodemap_cmd(const struct lu_env *env, struct mgs_device *mgs,
                    enum lcfg_command_type cmd, const char *nodemap_name,
-                   const char *param)
+                   char *param)
 {
        lnet_nid_t      nid[2];
        __u32           idmap[2];