Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-17592 build: kernel 6.8 removed strlcpy()
[fs/lustre-release.git]
/
lustre
/
mgc
/
mgc_request_server.c
diff --git
a/lustre/mgc/mgc_request_server.c
b/lustre/mgc/mgc_request_server.c
index
6eadd9d
..
15e2bf5
100644
(file)
--- a/
lustre/mgc/mgc_request_server.c
+++ b/
lustre/mgc/mgc_request_server.c
@@
-361,9
+361,9
@@
again:
body = req_capsule_client_get(&req->rq_pill, &RMF_MGS_CONFIG_BODY);
LASSERT(body);
LASSERT(sizeof(body->mcb_name) > strlen(cld->cld_logname));
body = req_capsule_client_get(&req->rq_pill, &RMF_MGS_CONFIG_BODY);
LASSERT(body);
LASSERT(sizeof(body->mcb_name) > strlen(cld->cld_logname));
- if (strlcpy(body->mcb_name, cld->cld_logname, sizeof(body->mcb_name))
-
>= sizeof(body->mcb_name)
)
- GOTO(out, rc
= -E2BIG
);
+ rc = strscpy(body->mcb_name, cld->cld_logname, sizeof(body->mcb_name));
+
if (rc < 0
)
+ GOTO(out, rc);
body->mcb_offset = config_read_offset;
body->mcb_type = cld->cld_type;
body->mcb_bits = PAGE_SHIFT;
body->mcb_offset = config_read_offset;
body->mcb_type = cld->cld_type;
body->mcb_bits = PAGE_SHIFT;