Whamcloud - gitweb
LU-5863 utils: Handle the special case of ldd_svname for mgs 64/12564/3
authorJames Simmons <uja.ornl@gmail.com>
Wed, 5 Nov 2014 00:43:44 +0000 (19:43 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 6 Nov 2014 18:00:48 +0000 (18:00 +0000)
Currently parse_ldd checks to see if ldd_svname is 8 or more
characters in length. This is true for all servers except
the mgs which is always labeled as "MGS". This can prevent
the mounting of the MGT. The solution is to see if we are
handling a MGT which doesn't require any extra type of
special handling that other OSD need.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I68582471e2b6ce47473a4fefb21e589c8c5b3730
Reviewed-on: http://review.whamcloud.com/12564
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/mount_lustre.c

index d32c77a..b070623 100644 (file)
@@ -422,18 +422,19 @@ static int parse_ldd(char *source, struct mount_opts *mop, char *options)
 
        /* svname of the form lustre:OST1234 means never registered */
        rc = strlen(ldd->ldd_svname);
-       if (rc < 8) {
-               fprintf(stderr, "%s: invalid name '%s'\n",
-                       progname, ldd->ldd_svname);
-               return EINVAL;
-       } else if (ldd->ldd_svname[rc - 8] == ':') {
-               ldd->ldd_svname[rc - 8] = '-';
-               ldd->ldd_flags |= LDD_F_VIRGIN;
-       } else if (ldd->ldd_svname[rc - 8] == '=') {
-               ldd->ldd_svname[rc - 8] = '-';
-               ldd->ldd_flags |= LDD_F_WRITECONF;
+       if (strcmp(ldd->ldd_svname, "MGS") != 0) {
+               if (rc < 8) {
+                       fprintf(stderr, "%s: invalid name '%s'\n",
+                               progname, ldd->ldd_svname);
+                       return EINVAL;
+               } else if (ldd->ldd_svname[rc - 8] == ':') {
+                       ldd->ldd_svname[rc - 8] = '-';
+                       ldd->ldd_flags |= LDD_F_VIRGIN;
+               } else if (ldd->ldd_svname[rc - 8] == '=') {
+                       ldd->ldd_svname[rc - 8] = '-';
+                       ldd->ldd_flags |= LDD_F_WRITECONF;
+               }
        }
-
        /* backend osd type */
        append_option(options, "osd=");
        strcat(options, mt_type(ldd->ldd_mount_type));