From: jxiong Date: Tue, 10 Feb 2009 04:01:34 +0000 (+0000) Subject: b=17914 X-Git-Tag: v1_9_160~26 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c8efb18aa080e2888b2b5f17d3a3972a00d5f54e;p=fs%2Flustre-release.git b=17914 r=nathan,h.huang Parse -MDTXXXX-mdc as mdt, in order to support CMD. --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 04d012c..5a618ff 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1684,6 +1684,18 @@ int server_name2index(char *svname, __u32 *idx, char **endptr) if (!dash) return(-EINVAL); + if (dash == svname) /* svname started w/ a `-' and only has one `-' */ + return(-EINVAL); + + /* intepret -MDTXXXXX-mdc as mdt, the better way is to pass + * in the fsname, then determine the server index */ + if (!strcmp(LUSTRE_MDC_NAME, dash + 1)) { + dash--; + for (; dash > svname && *dash != '-'; dash--); + if (dash == svname) + return(-EINVAL); + } + if (strncmp(dash + 1, "MDT", 3) == 0) rc = LDD_F_SV_TYPE_MDT; else if (strncmp(dash + 1, "OST", 3) == 0)