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>
/* svname of the form lustre:OST1234 means never registered */
rc = strlen(ldd->ldd_svname);
/* 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));
/* backend osd type */
append_option(options, "osd=");
strcat(options, mt_type(ldd->ldd_mount_type));