[LU-17104] build fix for gcc12 Created: 09/Sep/23  Updated: 23/Sep/23  Resolved: 23/Sep/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Shaun Tancheff Assignee: Shaun Tancheff
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Building master with gcc12 hit:

/home/shaun/lustre-release/lustre/quota/qmt_entry.c: In function ‘qti_lqes_restore_init’:
/home/shaun/lustre-release/lustre/quota/qmt_entry.c:1060:21: error: the comparison will always evaluate as ‘true’ for the address of ‘qti_lqes_rstr_small’ will never be NULL [-Werror=address]
 1060 |                 if (!qti_lqes_rstr(env))
      |                     ^
In file included from /home/shaun/lustre-release/lustre/quota/qmt_entry.c:33:
/home/shaun/lustre-release/lustre/quota/qmt_internal.h:242:41: note: ‘qti_lqes_rstr_small’ declared here
  242 |                 struct qmt_lqe_restore  qti_lqes_rstr_small[QMT_MAX_POOL_NUM];
      |                                         ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Which suggests that the if condition is using the wrong variable, probably should do:

                OBD_ALLOC(qmt_info(env)->qti_lqes_rstr,
                          qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore));
-               if (!qti_lqes_rstr(env))
+               if (!qmt_info(env)->qti_lqes_rstr)
                        rc = -ENOMEM;


 Comments   
Comment by Gerrit Updater [ 09/Sep/23 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52328
Subject: LU-17104 build: Correct test for bad allocation
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: b2d00f986831c0f166ab95e9634b575d1a94bbc2

Comment by Gerrit Updater [ 09/Sep/23 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52330
Subject: LU-17104 build: Correct test for bad allocation
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: cfe21d88b371501753cbba2bc867c89b1eb2aab6

Comment by Gerrit Updater [ 23/Sep/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52330/
Subject: LU-17104 build: Correct test for bad allocation
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9db00d1dbdf33f63ff5eb8f122aafc924f5425ff

Comment by Peter Jones [ 23/Sep/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:32:39 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.