Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / utils / mkfs_lustre.c
index e585e8d..2b9e5a6 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, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -376,8 +376,8 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
                         nids = convert_hostnames(optarg);
                         if (!nids)
                                 return 1;
-                        rc = add_param(mop->mo_ldd.ldd_params, PARAM_FAILNODE,
-                                       nids);
+                       rc = append_param(mop->mo_ldd.ldd_params,
+                                         PARAM_FAILNODE, nids, ':');
                         free(nids);
                         if (rc)
                                 return rc;
@@ -408,6 +408,13 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
                         }
                        /* LU-2374: check whether it is OST/MDT later */
                        mop->mo_ldd.ldd_svindex = atol(optarg);
+                       if (mop->mo_ldd.ldd_svindex >= INDEX_UNASSIGNED) {
+                               fprintf(stderr, "%s: wrong index %u. "
+                                       "Target index must be less than %u.\n",
+                                       progname, mop->mo_ldd.ldd_svindex,
+                                       INDEX_UNASSIGNED);
+                               return 1;
+                       }
                        mop->mo_ldd.ldd_flags &= ~LDD_F_NEED_INDEX;
                         break;
                 case 'k':
@@ -442,8 +449,8 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
                         char *nids = convert_hostnames(optarg);
                         if (!nids)
                                 return 1;
-                        rc = add_param(mop->mo_ldd.ldd_params, PARAM_MGSNODE,
-                                       nids);
+                       rc = append_param(mop->mo_ldd.ldd_params,
+                                         PARAM_MGSNODE, nids, ':');
                         free(nids);
                         if (rc)
                                 return rc;
@@ -638,7 +645,7 @@ int main(int argc, char *const argv[])
                 goto out;
         }
 
-       /* Stand alone MGS doesn't need a index */
+       /* Stand alone MGS doesn't need an index */
        if (!IS_MDT(ldd) && IS_MGS(ldd)) {
 #ifndef TUNEFS /* mkfs.lustre */
                /* But if --index was specified flag an error */