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>
#endif
struct posix_acl *acl, int type)
{
+#ifdef HAVE_ACL_WITH_DENTRY
+ struct inode *inode = dentry->d_inode;
+#endif
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *req = NULL;
const char *name = NULL;
while (p + sizeof(randbuf2) - (char *)pageaddr < count) {
get_random_bytes(randbuf2, sizeof(randbuf2));
memcpy(p, randbuf2, sizeof(randbuf2));
- p += sizeof(randbuf2) + prandom_u32_max(1 << 13);
+ p += sizeof(randbuf2) + get_random_u32_below(1 << 13);
}
kunmap(page);
return count;
*/
if (strstr(record, add_pool))
lpd->lpd_ost_num++;
- } else if (lpd->lpd_ostname && lpd->lpd_ostname[0]) {
+ } else if (lpd->lpd_ostname[0] != '\0') {
if (strstr(record, lpd->lpd_ostname)) {
lpd->lpd_pool_exists = true;
if (strstr(record, add_pool)) {