Current mgs assumes that all the NIDs in a single failover.node
parameter belong to one node. This is not the case, even prior to
http://review.whamcloud.com/11161, because mkfs.lustre options like
--servicenode=<nid1>,<nid2>:<nid3>,<nid4>
are allowed.
Change-Id: If3e2ebc0e81093e9c8304e496afdca24edf456ef
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/11956
Tested-by: Jenkins
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
#07 L add_conn 0:OSC_uml1_ost1_mdsA 1:uml2_UUID
*/
#07 L add_conn 0:OSC_uml1_ost1_mdsA 1:uml2_UUID
*/
- /* Pull failnid info out of params string */
+ /*
+ * Pull failnid info out of params string, which may contain something
+ * like "<nid1>,<nid2>:<nid3>,<nid4>". class_parse_nid() does not
+ * complain about abnormal inputs like ",:<nid1>", "<nid1>:,<nid2>",
+ * etc. However, convert_hostnames() should have caught those.
+ */
while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
while (class_parse_nid(ptr, &nid, &ptr) == 0) {
if (failnodeuuid == NULL) {
while (class_find_param(ptr, PARAM_FAILNODE, &ptr) == 0) {
while (class_parse_nid(ptr, &nid, &ptr) == 0) {
if (failnodeuuid == NULL) {
"client %s\n", libcfs_nid2str(nid),
failnodeuuid, cliname);
rc = record_add_uuid(env, llh, nid, failnodeuuid);
"client %s\n", libcfs_nid2str(nid),
failnodeuuid, cliname);
rc = record_add_uuid(env, llh, nid, failnodeuuid);
+ /*
+ * If *ptr is ':', we have added all NIDs for
+ * failnodeuuid.
+ */
+ if (*ptr == ':') {
+ rc = record_add_conn(env, llh, cliname,
+ failnodeuuid);
+ name_destroy(&failnodeuuid);
+ failnodeuuid = NULL;
+ }
+ }
if (failnodeuuid) {
rc = record_add_conn(env, llh, cliname, failnodeuuid);
name_destroy(&failnodeuuid);
failnodeuuid = NULL;
}
if (failnodeuuid) {
rc = record_add_conn(env, llh, cliname, failnodeuuid);
name_destroy(&failnodeuuid);
failnodeuuid = NULL;
}
}
static int mgs_write_log_mdc_to_lmv(const struct lu_env *env,
}
static int mgs_write_log_mdc_to_lmv(const struct lu_env *env,