]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/122: fix EFI/EFD log format structure size after flex array conversion
authorDarrick J. Wong <djwong@kernel.org>
Wed, 21 Dec 2022 00:21:42 +0000 (16:21 -0800)
committerZorro Lang <zlang@kernel.org>
Sun, 25 Dec 2022 13:20:52 +0000 (21:20 +0800)
Adjust this test since made EFI/EFD log item format structs proper flex
arrays instead of array[1].

This adjustment was made to the kernel source tree as part of a project
to make the use of flex arrays more consistent throughout the kernel.
Converting array[1] and array[0] to array[] also avoids bugs in various
compiler ports that mishandle the array size computation.  Prior to the
introduction of xfs_ondisk.h, these miscomputations resulted in kernels
that would silently write out filesystem structures that would then not
be recognized by more mainstream systems (e.g.  x86).

OFC nearly all those reports about buggy compilers are for tiny
architectures that XFS doesn't work well on anyways, so in practice it
hasn't created any user problems (AFAIK).

[zlang: Add more comments to new helpers]

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/xfs/122
tests/xfs/122.out

index 8060c03b7d1861c72936232ac2cf1a6c94940849..30a2a0985ba073c0a3b0a186bb047ba666fcefae 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1502,6 +1502,26 @@ _fixed_by_kernel_commit()
        _fixed_by_git_commit kernel $*
 }
 
+# Compare with _fixed_by_* helpers, this helper is used for test cases
+# are not regression tests, e.g. functional tests or maintainer tests,
+# this helper suggests git commits that should be applied to source trees
+# to avoid test failures.
+_wants_git_commit()
+{
+       local pkg=$1
+       shift
+
+       echo "This test wants $pkg fix:" >> $seqres.hints
+       echo "      $*" >> $seqres.hints
+       echo >> $seqres.hints
+}
+
+# Refer to _wants_git_commit
+_wants_kernel_commit()
+{
+       _wants_git_commit kernel $*
+}
+
 _check_if_dev_already_mounted()
 {
        local dev=$1
index 91083d6036bf8e30d881023311f288a959175397..e616f1987dfb4d8e5065ad5deaa0770f47bfa929 100755 (executable)
@@ -17,6 +17,11 @@ _begin_fstest other auto quick clone realtime
 _supported_fs xfs
 _require_command "$INDENT_PROG" indent
 
+# Starting in Linux 6.1, the EFI log formats were adjusted away from using
+# single-element arrays as flex arrays.
+_wants_kernel_commit 03a7485cd701 \
+       "xfs: fix memcpy fortify errors in EFI log format copying"
+
 # filter out known changes to xfs type sizes
 _type_size_filter()
 {
index a56cbee84ff8500d1fb786be3ac88db77a9311ce..95e53c5081c263d6b9383488437944eac855a088 100644 (file)
@@ -161,10 +161,10 @@ sizeof(xfs_disk_dquot_t) = 104
 sizeof(xfs_dq_logformat_t) = 24
 sizeof(xfs_dqblk_t) = 136
 sizeof(xfs_dsb_t) = 264
-sizeof(xfs_efd_log_format_32_t) = 28
-sizeof(xfs_efd_log_format_64_t) = 32
-sizeof(xfs_efi_log_format_32_t) = 28
-sizeof(xfs_efi_log_format_64_t) = 32
+sizeof(xfs_efd_log_format_32_t) = 16
+sizeof(xfs_efd_log_format_64_t) = 16
+sizeof(xfs_efi_log_format_32_t) = 16
+sizeof(xfs_efi_log_format_64_t) = 16
 sizeof(xfs_error_injection_t) = 8
 sizeof(xfs_exntfmt_t) = 4
 sizeof(xfs_exntst_t) = 4