Whamcloud - gitweb
LU-18127 autoconf: fix configure tests -Warray-bounds errors 89/55989/2
authorJian Yu <yujian@whamcloud.com>
Sat, 10 Aug 2024 07:07:59 +0000 (00:07 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 22:03:36 +0000 (22:03 +0000)
commita78894ee642d423a244fc0dcbc518c57a458a2db
tree64086c97fd62653939619dba3a9f00b08596c7cd
parent3c02fc1d4c5113169b68fadc3ecc3386fb1634c4
LU-18127 autoconf: fix configure tests -Warray-bounds errors

Kernel commit v5.17-rc3-1-ge6148767825c (Makefile:
Enable -Warray-bounds) enabled -Warray-bounds option,
which caused Lustre configure tests hit false failures
as follows:

  build/conftest.c: In function 'main':
  build/conftest.c:228:39: error: array subscript 0 is
    outside array bounds of 'struct inode_operations[0]'
    [-Werror=array-bounds]
    228 | ((struct inode_operations *)1)->get_acl((struct inode *)NULL, 0, false);
        |                                       ^~
  cc1: all warnings being treated as errors

This patch fixes the "struct inode_operations" related
configure tests to avoid the above failures.

The -Warray-bounds option was disabled by the following
kernel commits:
- v5.19-rc1-28-gf0be87c42cbd (gcc-12: disable '-Warray-bounds' universally for now)
- v6.2-rc3-9-g5a41237ad1d4 (gcc: disable -Warray-bounds for gcc-11 too)
- v6.3-rc7-202-g0da6e5fd6c37 (gcc: disable '-Warray-bounds' for gcc-13 too)

Test-Parameters: mdtcount=4 mdscount=2 \
  clientdistro=ubuntu2204 testlist=sanity
Test-Parameters: mdtcount=4 mdscount=2 \
  env=SANITY_EXCEPT="27J 103a 244a" \
  clientdistro=sles15sp6 testlist=sanity
Test-Parameters: optional mdtcount=4 mdscount=2 \
  clientdistro=ubuntu2404 testlist=sanity

Change-Id: Iee73962ffc117a2f98e8f339462820aff2278815
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55989
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4