Whamcloud - gitweb
LU-10391 mgs: handle strscpy return value properly 71/53571/3
authorJames Simmons <jsimmons@infradead.org>
Tue, 2 Jan 2024 00:11:35 +0000 (19:11 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Jan 2024 07:28:48 +0000 (07:28 +0000)
commit015f645651173fbc65ee21eadb14470881d4d512
treeea10feaf725f65d17d39d3424f167275f02938f5
parentb62c385e180fbdf85533e334fa63d6b9c6bb2452
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53571
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.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