Whamcloud - gitweb
LU-14428 libcfs: discard cfs_trace_copyin_string()
authorAlex Zhuravlev <bzzz@whamcloud.com>
Wed, 12 Oct 2022 06:35:42 +0000 (09:35 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Oct 2022 20:00:32 +0000 (20:00 +0000)
commita75e6be666966dc14e631caf5cbc14068b39b2fa
treebca089e248dc8cdda6520256f2a9160ed4c8dad3
parentdd7b070d1491325b01d4f0380152b979c7a9abd4
LU-14428 libcfs: discard cfs_trace_copyin_string()

Instead of cfs_trace_copyin_string(), use memdup_user_nul().
This combines the allocation with the copyin, and nul-terminates.

The resulting code is a lot simpler.

Lustre-change: https://review.whamcloud.com/41490
Lustre-commit: 67af976c806994cec27414d24b43f6519d72c240

LU-14788 lnet: check memdup_user_nul using IS_ERR

Crash in __proc_lnet_portal_rotor. memdup_user_nul returns an ERR_PTR
on error, not a NULL pointer. IS_ERR and PTR_ERR functions have to be
used to check and return the correct error code. The fix has been
applied in other locations having the wrong check.

Lustre-change: https://review.whamcloud.com/44091
Lustre-commit: 449d046e55a42cc4d1c4ab0217551cded1864bc4

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I089c5da96b59ec62d177aea2f3d170bf751c6fec
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48835
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
libcfs/libcfs/module.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/tracefile.h
lnet/lnet/router_proc.c