Whamcloud - gitweb
LU-17793 libcfs: fix objtool warning in lbug_with_loc()
After lbug_with_loc() was removed from the objtool
global_noreturns array in Linux commit v6.4-rc2-10-g34245659debd,
building Lustre hit the following warning:
libcfs/libcfs/fail.o: warning: objtool: __cfs_fail_check_set()
falls through to next function __cfs_fail_timeout_set()
This patch fixes the above warning by adding an unreachable
panic() at the end of lbug_with_loc() to terminate all of
the call paths in that function.
As a consequence of this change, we need to make the patch
fix more errors, such as:
lnet/lnet/api-ni.c: In function 'lnet_res_type2str':
libcfs/include/libcfs/libcfs_private.h:119:9:
error: this statement may fall through [-Werror=implicit-fallthrough=]
119 | lbug_with_loc(&msgdata); \
| ^~~~~~~~~~~~~~~~~~~~~~~
lnet/lnet/api-ni.c:1143:17: note: in expansion of macro 'LBUG'
1143 | LBUG();
| ^~~~
lnet/lnet/api-ni.c:1144:9: note: here
1144 | case LNET_COOKIE_TYPE_MD:
| ^~~~
and
lustre/obdclass/lprocfs_status.c: In function 'lprocfs_stats_lock':
lustre/obdclass/lprocfs_status.c:470:1:
error: control reaches end of non-void function [-Werror=return-type]
470 | }
| ^
Change-Id: I5574559619b4b6746f4e7da51f3213ede246a73b
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55505
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Bruno Faccini <bfaccini@nvidia.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>