linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: Fix xfs_dir2_sf_entry_t size check
@ 2020-01-09 14:14 Vincenzo Frascino
  2020-01-09 15:01 ` Eric Sandeen
  2020-01-12  0:44 ` kbuild test robot
  0 siblings, 2 replies; 12+ messages in thread
From: Vincenzo Frascino @ 2020-01-09 14:14 UTC (permalink / raw)
  To: darrick.wong, linux-xfs, linux-kernel; +Cc: vincenzo.frascino

xfs_check_ondisk_structs() verifies that the sizes of the data types
used by xfs are correct via the XFS_CHECK_STRUCT_SIZE() macro.

xfs_dir2_sf_entry_t size is set erroneously to 3 which breaks the
compilation with the assertion below:

In file included from linux/include/linux/string.h:6,
                 from linux/include/linux/uuid.h:12,
                 from linux/fs/xfs/xfs_linux.h:10,
                 from linux/fs/xfs/xfs.h:22,
                 from linux/fs/xfs/xfs_super.c:7:
In function ‘xfs_check_ondisk_structs’,
    inlined from ‘init_xfs_fs’ at linux/fs/xfs/xfs_super.c:2025:2:
linux/include/linux/compiler.h:350:38:
    error: call to ‘__compiletime_assert_107’ declared with attribute
    error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3
    _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)

Restore the correct behavior defining the correct size.

Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 fs/xfs/xfs_ondisk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_ondisk.h b/fs/xfs/xfs_ondisk.h
index b6701b4f59a9..ee487ddc60c7 100644
--- a/fs/xfs/xfs_ondisk.h
+++ b/fs/xfs/xfs_ondisk.h
@@ -104,7 +104,7 @@ xfs_check_ondisk_structs(void)
 	XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t,		16);
 	XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t,			16);
 	XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t,		4);
-	XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t,		3);
+	XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t,		4);
 	XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, namelen,		0);
 	XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, offset,		1);
 	XFS_CHECK_OFFSET(xfs_dir2_sf_entry_t, name,		3);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-01-13 17:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 14:14 [PATCH] xfs: Fix xfs_dir2_sf_entry_t size check Vincenzo Frascino
2020-01-09 15:01 ` Eric Sandeen
2020-01-09 15:35   ` Vincenzo Frascino
2020-01-09 16:50     ` Darrick J. Wong
     [not found]       ` <435bcb71-9126-b1f1-3803-4977754b36ff@arm.com>
2020-01-13 13:55         ` Arnd Bergmann
2020-01-13 13:58           ` Christoph Hellwig
2020-01-13 14:06             ` Arnd Bergmann
2020-01-13 17:01               ` Darrick J. Wong
2020-01-13 17:04                 ` Eric Sandeen
2020-01-13 17:26                 ` Vincenzo Frascino
2020-01-13 14:05           ` Vincenzo Frascino
2020-01-12  0:44 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).