From: James Simmons Date: Wed, 5 Nov 2014 00:43:44 +0000 (-0500) Subject: LU-5863 utils: Handle the special case of ldd_svname for mgs X-Git-Tag: 2.6.90~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2b7a61db651749e408e4935f69ee1b19a18d61e1;p=fs%2Flustre-release.git LU-5863 utils: Handle the special case of ldd_svname for mgs 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 Change-Id: I68582471e2b6ce47473a4fefb21e589c8c5b3730 Reviewed-on: http://review.whamcloud.com/12564 Reviewed-by: Andreas Dilger Tested-by: Jenkins Reviewed-by: Dmitry Eremin Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index d32c77a..b070623 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -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));