linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: mark xfs_dir2_sf_entry_t as __packed again
@ 2019-03-04 19:36 Arnd Bergmann
  2019-03-08 15:29 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-03-04 19:36 UTC (permalink / raw)
  To: Darrick J. Wong, linux-xfs
  Cc: Christoph Hellwig, Arnd Bergmann, Dave Chinner, Brian Foster,
	linux-kernel

For ARM OABI builds, we run into a compile time assertion:

inlined from 'init_xfs_fs' at /git/arm-soc/fs/xfs/xfs_super.c:1991:2:
fs/xfs/xfs_ondisk.h:119:208: error: call to '__compiletime_assert_119' declared with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3

While ARM OABI is pretty much dead and fails to build for typical
configurations on modern architectures (ARMv6 or higher), and has
been declared deprecated in user space since gcc-4.6, the kernel
still allows it to used for building the kernel.

In commit 8353a649f577 ("xfs: kill xfs_dir2_sf_off_t"), Christoph
removed the old __arch_pack annotation that made it possible to
build xfs with oddball ABIs. However, OABI not only requrires
padding around short structure but still adds padding after this
change. There is no harm to unconditionally mark the structure as
__packed now, and that will do the right thing here.

As of commit aa2dd0ad4d6d ("xfs: remove __arch_pack"), we need to
use __packed here as well, instead of the old __arch_pack.

Fixes: 8353a649f577 ("xfs: kill xfs_dir2_sf_off_t")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/xfs/libxfs/xfs_da_format.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
index ae654e06b2fb..fa8f07451d39 100644
--- a/fs/xfs/libxfs/xfs_da_format.h
+++ b/fs/xfs/libxfs/xfs_da_format.h
@@ -230,7 +230,7 @@ typedef struct xfs_dir2_sf_entry {
 	 * A 64-bit or 32-bit inode number follows here, at a variable offset
 	 * after the name.
 	 */
-} xfs_dir2_sf_entry_t;
+} __packed xfs_dir2_sf_entry_t;
 
 static inline int xfs_dir2_sf_hdr_size(int i8count)
 {
-- 
2.20.0


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

* Re: [PATCH] xfs: mark xfs_dir2_sf_entry_t as __packed again
  2019-03-04 19:36 [PATCH] xfs: mark xfs_dir2_sf_entry_t as __packed again Arnd Bergmann
@ 2019-03-08 15:29 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2019-03-08 15:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Darrick J. Wong, linux-xfs, Christoph Hellwig, Dave Chinner,
	Brian Foster, linux-kernel

On Mon, Mar 04, 2019 at 08:36:47PM +0100, Arnd Bergmann wrote:
> For ARM OABI builds, we run into a compile time assertion:
> 
> inlined from 'init_xfs_fs' at /git/arm-soc/fs/xfs/xfs_super.c:1991:2:
> fs/xfs/xfs_ondisk.h:119:208: error: call to '__compiletime_assert_119' declared with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3
> 
> While ARM OABI is pretty much dead and fails to build for typical
> configurations on modern architectures (ARMv6 or higher), and has
> been declared deprecated in user space since gcc-4.6, the kernel
> still allows it to used for building the kernel.
> 
> In commit 8353a649f577 ("xfs: kill xfs_dir2_sf_off_t"), Christoph
> removed the old __arch_pack annotation that made it possible to
> build xfs with oddball ABIs. However, OABI not only requrires
> padding around short structure but still adds padding after this
> change. There is no harm to unconditionally mark the structure as
> __packed now, and that will do the right thing here.
> 
> As of commit aa2dd0ad4d6d ("xfs: remove __arch_pack"), we need to
> use __packed here as well, instead of the old __arch_pack.

I don't think we want more __packed attributes than required.  Given
how dead OABI is can we just have XFS depend on !OABI?

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

end of thread, other threads:[~2019-03-08 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 19:36 [PATCH] xfs: mark xfs_dir2_sf_entry_t as __packed again Arnd Bergmann
2019-03-08 15:29 ` Christoph Hellwig

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).