From 2b7a61db651749e408e4935f69ee1b19a18d61e1 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 4 Nov 2014 19:43:44 -0500 Subject: [PATCH] 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 --- lustre/utils/mount_lustre.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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)); -- 1.8.3.1