Whamcloud - gitweb
LU-13306 mgs: support large NID for mgs_write_log_osc_to_lov 53/52053/5
authorJames Simmons <jsimmons@infradead.org>
Wed, 23 Aug 2023 14:46:34 +0000 (10:46 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 31 Aug 2023 01:43:06 +0000 (01:43 +0000)
The various llogs on the MGS needed to be updated to support both
64 bit NID size and the newer large NID format. The function
mgs_write_log_osc_to_lov was missed in this update.

Test-Parameters: trivial testlist=runtests ossversion=2.15.3
Fixes: c0cb747ebe9 ("LU-13306 mgs: use large NIDS in the nid table on the MGS")
Change-Id: If543a0421d1f3cac9827581ce46da911c3456efd
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52053
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mgs/mgs_llog.c

index 9550c1b..0781c6c 100644 (file)
@@ -3091,7 +3091,7 @@ static int mgs_write_log_osc_to_lov(const struct lu_env *env,
                nidstr = mti->mti_nidlist[0];
        }
 
-       rc = name_create(&nodeuuid, mti->mti_nidlist[0], "");
+       rc = name_create(&nodeuuid, nidstr, "");
        if (rc)
                RETURN(rc);
        rc = name_create(&svname, mti->mti_svname, "-osc");
@@ -3144,9 +3144,13 @@ static int mgs_write_log_osc_to_lov(const struct lu_env *env,
        for (i = 0; i < mti->mti_nid_count; i++) {
                struct lnet_nid nid;
 
-               rc = libcfs_strnid(&nid, mti->mti_nidlist[i]);
-               if (rc < 0)
-                       GOTO(out_end, rc);
+               if (target_supports_large_nid(mti)) {
+                       rc = libcfs_strnid(&nid, mti->mti_nidlist[i]);
+                       if (rc < 0)
+                               GOTO(out_end, rc);
+               } else {
+                       lnet_nid4_to_nid(mti->mti_nids[i], &nid);
+               }
 
                CDEBUG(D_MGS, "add nid %s\n", libcfs_nidstr(&nid));
                rc = record_add_uuid(env, llh, &nid, nodeuuid);