Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
filesystems
lustre_2_15
0001-LU-16363-build-fiemap-flexible-array.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-LU-16363-build-fiemap-flexible-array.patch of Package lustre_2_15
From 9043e5e6d0afc60510590000de387cab97dc6a7d Mon Sep 17 00:00:00 2001 From: Shaun Tancheff <shaun.tancheff@hpe.com> Date: Sun, 4 Dec 2022 22:32:35 -0600 Subject: [PATCH 01/30] LU-16363 build: fiemap flexible array Linux commit v5.19-rc2-1-g94dfc73e7cf4 treewide: uapi: Replace zero-length arrays with flexible-array members Adjust wiretest to handle flexible array when sizeof(fiemap->fm_extents) is undefined. Test-Parameters: trivial HPE-bug-id: LUS-11388 Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com> Change-Id: Ia2692d126a871b43e9144e5d151215166604702d --- lustre/ptlrpc/wiretest.c | 3 +-- lustre/utils/wirecheck.c | 11 ++++++++++- lustre/utils/wiretest.c | 3 +-- 3 files changed, 12 insertions(+), 5 deletions(-) --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -4719,8 +4719,7 @@ void lustre_assert_wire_constants(void) (long long)(int)sizeof(((struct fiemap *)0)->fm_reserved)); LASSERTF((int)offsetof(struct fiemap, fm_extents) == 32, "found %lld\n", (long long)(int)offsetof(struct fiemap, fm_extents)); - LASSERTF((int)sizeof(((struct fiemap *)0)->fm_extents) == 0, "found %lld\n", - (long long)(int)sizeof(((struct fiemap *)0)->fm_extents)); + BUILD_BUG_ON(offsetof(struct fiemap, fm_extents) != sizeof(struct fiemap)); BUILD_BUG_ON(FIEMAP_FLAG_SYNC != 0x00000001); BUILD_BUG_ON(FIEMAP_FLAG_XATTR != 0x00000002); BUILD_BUG_ON(FIEMAP_FLAG_DEVICE_ORDER != 0x40000000); --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -57,6 +57,9 @@ do { \ #define STRINGIFY(a) #a +#define CHECK_BUILD_TEST(a) \ + printf(" BUILD_BUG_ON("#a");\n") + #define CHECK_CDEFINE(a) \ printf(" BUILD_BUG_ON("#a" != "STRINGIFY(a) ");\n") @@ -148,6 +151,12 @@ do { \ CHECK_BUILD_TEST(offsetof(struct s, m) != sizeof(struct s)); \ } while (0) +#define CHECK_MEMBER_IS_FLEXIBLE_OR_ZERO_LENGTH(s, m) \ +do { \ + CHECK_MEMBER_OFFSET(s, m); \ + CHECK_BUILD_TEST(offsetof(struct s, m) != sizeof(struct s)); \ +} while (0) + #define CHECK_MEMBER(s, m) \ do { \ CHECK_MEMBER_OFFSET(s, m); \ @@ -2228,7 +2237,7 @@ check_ll_user_fiemap(void) CHECK_MEMBER(fiemap, fm_mapped_extents); CHECK_MEMBER(fiemap, fm_extent_count); CHECK_MEMBER(fiemap, fm_reserved); - CHECK_MEMBER_IS_FLEXIBLE(fiemap, fm_extents); + CHECK_MEMBER_IS_FLEXIBLE_OR_ZERO_LENGTH(fiemap, fm_extents); CHECK_CDEFINE(FIEMAP_FLAG_SYNC); CHECK_CDEFINE(FIEMAP_FLAG_XATTR); --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -4745,8 +4745,7 @@ void lustre_assert_wire_constants(void) (long long)(int)sizeof(((struct fiemap *)0)->fm_reserved)); LASSERTF((int)offsetof(struct fiemap, fm_extents) == 32, "found %lld\n", (long long)(int)offsetof(struct fiemap, fm_extents)); - LASSERTF((int)sizeof(((struct fiemap *)0)->fm_extents) == 0, "found %lld\n", - (long long)(int)sizeof(((struct fiemap *)0)->fm_extents)); + BUILD_BUG_ON(offsetof(struct fiemap, fm_extents) != sizeof(struct fiemap)); BUILD_BUG_ON(FIEMAP_FLAG_SYNC != 0x00000001); BUILD_BUG_ON(FIEMAP_FLAG_XATTR != 0x00000002); BUILD_BUG_ON(FIEMAP_FLAG_DEVICE_ORDER != 0x40000000);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor