From 576928b2cd7dcdb6fcb6000ef593ecfb03f66500 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 23 Aug 2023 10:46:34 -0400 Subject: [PATCH] LU-13306 mgs: support large NID for mgs_write_log_osc_to_lov 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 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52053 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/mgs/mgs_llog.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 9550c1b..0781c6c 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -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); -- 1.8.3.1