[LU-17193] RHEL 9.2 building with gcc12 hits a few issues Created: 13/Oct/23  Updated: 27/Oct/23  Resolved: 25/Oct/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   

gcc12 breaks a couple of compile tests:

/home/shaun/lustre-release/_lpb/fileattr_set_pc/fileattr_set_pc.c: In function ‘main’:
/home/shaun/lustre-release/_lpb/fileattr_set_pc/fileattr_set_pc.c:74:32: error: array subscript 0 is outside array bounds of ‘struct inode_operations[0]’ [-Werror=array-bounds]
   74 |  ((struct inode_operations *)1)->fileattr_get(NULL, NULL);
      |                                ^~

A couple of compile tests have an invalid '3rd' argument (cleanup).

A few QCTL_COPY() macros hit:

In function ‘strnlen’,
    inlined from ‘mdc_iocontrol’ at /home/shaun/lustre-release/lustre/mdc/mdc_request.c:2286:4:
include/linux/fortify-string.h:23:34: error: array subscript 112 is outside array bounds of ‘void[112]’ [-Werror=array-bounds]
   23 |             __builtin_constant_p(*__p)) {                       \
      |                                  ^~~~
include/linux/fortify-string.h:141:24: note: in expansion of macro ‘__compiletime_strlen’
  141 |         size_t p_len = __compiletime_strlen(p);
      |                        ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/fs.h:44,
                 from include/linux/huge_mm.h:8,
                 from include/linux/mm.h:707,
                 from include/linux/pagemap.h:8,
                 from /home/shaun/lustre-release/lustre/mdc/mdc_request.c:37:
In function ‘kmalloc’,
    inlined from ‘mdc_iocontrol’ at /home/shaun/lustre-release/lustre/mdc/mdc_request.c:2279:3:
include/linux/slab.h:611:24: note: at offset 112 into object of size 112 allocated by ‘kmem_cache_alloc_trace’
  611 |                 return kmem_cache_alloc_trace(
      |                        ^~~~~~~~~~~~~~~~~~~~~~~
  612 |                                 kmalloc_caches[kmalloc_type(flags)][index],
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  613 |                                 flags, size);
      |                                 ~~~~~~~~~~~~
cc1: all warnings being treated as errors


 Comments   
Comment by Gerrit Updater [ 13/Oct/23 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52687
Subject: LU-17193 build: fix gcc-12 compiler warnings
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 5dcfa0102db60cec25769b39d34649f2d516045e

Comment by Gerrit Updater [ 25/Oct/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52687/
Subject: LU-17193 build: fix gcc-12 compiler warnings
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 1b0de05f81372eeda9a2a38142553ead7e88a431

Comment by Peter Jones [ 25/Oct/23 ]

Landed for 2.16

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