From: James Simmons Date: Tue, 2 Jan 2024 00:11:35 +0000 (-0500) Subject: LU-10391 mgs: handle strscpy return value properly X-Git-Tag: 2.15.61~108 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F53571%2F3;p=fs%2Flustre-release.git LU-10391 mgs: handle strscpy return value properly The function strscpy() returns either an error code or the length of the string copied. We need on success of strscpy in the function mgs_steal_client_llog_handler() reset rc to zero to avoid the return value been seen as an error. While we could use large NIDs some functionality like nodemap was failing due to this mishandling of the return code. Fixes: c0cb747ebe9 ("LU-13306 mgs: use large NIDS in the nid table on the MGS") Test-Parameters: trivial Change-Id: I013d34e0d0223367efea97f71dd4baa1052e2e1b Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53571 Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index d547b168..41f08c6 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -2244,6 +2244,7 @@ static int mgs_steal_client_llog_handler(const struct lu_env *env, LNET_NIDSTR_SIZE); if (rc < 0) RETURN(rc); + rc = 0; } else { tmti->mti_nids[tmti->mti_nid_count] = libcfs_str2nid(nidstr);