Whamcloud - gitweb
LU-16980 build: fix gcc-12 [-Werror=address] error
authorJian Yu <yujian@whamcloud.com>
Tue, 1 Aug 2023 08:09:25 +0000 (01:09 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 1 Aug 2023 22:04:19 +0000 (22:04 +0000)
commite0760110fd89f85e1f7b30f00054bb51e580031c
tree02d0dbb3c135bb41b2ac88dd1b630b0ca2ce132d
parent1ae4ade28a28bc45811505a31667c2cafd6c5b92
LU-16980 build: fix gcc-12 [-Werror=address] error

This patch fixes the following [-Werror=address] error
detected by gcc 12 and other errors caused by incomplete
porting in commit 1ef38b1258f1 to b_es6_0:

lustre/utils/obd.c: In function 'llog_search_pool_cb':
lustre/utils/obd.c:3816:28: error: the comparison will always evaluate
as 'true' for the address of 'lpd_ostname' will never be NULL
 3816 |       } else if (lpd->lpd_ostname && lpd->lpd_ostname[0]) {
      |                  ^~~
obd.c:3747:14: note: 'lpd_ostname' declared here
 3747 |       char lpd_ostname[MAX_OBD_NAME + 1];
      |            ^~~~~~~~~~~

lustre/tests/kernel/kcompr.c: In function 'fill_input_with_rand':
lustre/tests/kernel/kcompr.c:144:41: error: implicit declaration of
function 'prandom_u32_max'; did you mean 'prandom_u32_state'?
  144 |       p += sizeof(randbuf2) + prandom_u32_max(1 << 13);
      |                               ^~~~~~~~~~~~~~~
      |                               prandom_u32_state

lustre/llite/file.c: In function 'll_set_acl':
lustre/llite/file.c:5900:43: error: 'inode' undeclared
 5900 |       struct ll_sb_info *sbi = ll_i2sbi(inode);
      |                                         ^~~~~

Fixes: 1ef38b1258f1 ("LU-16594 build: get_random_u32_below, get_acl with dentry")
Change-Id: I9206fa169880ae16e192d17c8f144ed3b83c65a3
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51829
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/file.c
lustre/tests/kernel/kcompr.c
lustre/utils/obd.c