X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmgs%2Fmgs_llog.c;h=1fbc87d671cffe680d6667361cfe89b7023c96f3;hb=bbe5f8ec92c63cc4fcb9ab0b316e92fb2a3d9683;hp=161d3863b51d7d9ade4f2342197b392814b0de9f;hpb=21d716e6c16424d9deb646456758ebbaa9c70fec;p=fs%2Flustre-release.git diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 161d386..1fbc87d 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1883,7 +1883,12 @@ static int mgs_write_log_failnids(const struct lu_env *env, #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 ",:,". class_parse_nid() does not + * complain about abnormal inputs like ",:", ":,", + * 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) { @@ -1898,15 +1903,25 @@ static int mgs_write_log_failnids(const struct lu_env *env, "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; } - } + } - return rc; + return rc; } static int mgs_write_log_mdc_to_lmv(const struct lu_env *env,