Skip to contentSkip to conversation

linux-next: build failure after merge of the btrfs tree

PATCH Stephen Rothwell 3 participants 7 messages Apr 21, 2020 – Apr 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

In file included from <command-line>:32:
./usr/include/linux/btrfs_tree.h:1127:2: error: unknown type name 'u8'

 1127 |  u8 tree_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1128:2: error: unknown type name 'u8'
 1128 |  u8 chunk_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1129:2: error: unknown type name 'u8'
 1129 |  u8 extent_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1130:2: error: unknown type name 'u8'
 1130 |  u8 fs_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1131:2: error: unknown type name 'u8'
 1131 |  u8 dev_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1132:2: error: unknown type name 'u8'
 1132 |  u8 csum_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1134:2: error: unknown type name 'u8'
 1134 |  u8 unused_8[10];
      |  ^~
./usr/include/linux/btrfs_tree.h:1148:2: error: unknown type name 'u8'
 1148 |  u8 csum[BTRFS_CSUM_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1150:2: error: unknown type name 'u8'
 1150 |  u8 fsid[BTRFS_FSID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1177:2: error: unknown type name 'u8'
 1177 |  u8 root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1178:2: error: unknown type name 'u8'
 1178 |  u8 chunk_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1179:2: error: unknown type name 'u8'
 1179 |  u8 log_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1188:2: error: unknown type name 'u8'
 1188 |  u8 metadata_uuid[BTRFS_FSID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1192:2: error: unknown type name 'u8'
 1192 |  u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1283:2: error: unknown type name 'u8'
 1283 |  u8 csum[BTRFS_CSUM_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1284:2: error: unknown type name 'u8'
 1284 |  u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
      |  ^~
./usr/include/linux/btrfs_tree.h:1289:2: error: unknown type name 'u8'
 1289 |  u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1293:2: error: unknown type name 'u8'
 1293 |  u8 level;
      |  ^~

Caused by commit

8d80a063d508 ("btrfs: move on-disk structure definitions to btrfs_tree.h")

They should probably all be __u8 ...

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Tue, 21 Apr 2020 10:19:20 +1000
Subject: [PATCH] btrfs: uapi headers should use __<type>

---
 include/uapi/linux/btrfs_tree.h | 36 ++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 18 deletions(-)
include/uapi/linux/btrfs_tree.h +18 -18
index a02318e4d2a9..1adf5971a966 100644
@@ -1124,14 +1124,14 @@ struct btrfs_root_backup {
 	/* future */
 	__le64 unused_64[4];
 
-	u8 tree_root_level;
-	u8 chunk_root_level;
-	u8 extent_root_level;
-	u8 fs_root_level;
-	u8 dev_root_level;
-	u8 csum_root_level;
+	__u8 tree_root_level;
+	__u8 chunk_root_level;
+	__u8 extent_root_level;
+	__u8 fs_root_level;
+	__u8 dev_root_level;
+	__u8 csum_root_level;
 	/* future and to align */
-	u8 unused_8[10];
+	__u8 unused_8[10];
 } __attribute__ ((__packed__));
 
 /*
@@ -1145,9 +1145,9 @@ struct btrfs_root_backup {
 /* The super block basically lists the main trees of the FS. */
 struct btrfs_super_block {
 	/* The first 4 fields must match struct btrfs_header */
-	u8 csum[BTRFS_CSUM_SIZE];
+	__u8 csum[BTRFS_CSUM_SIZE];
 	/* FS specific UUID, visible to user */
-	u8 fsid[BTRFS_FSID_SIZE];
+	__u8 fsid[BTRFS_FSID_SIZE];
 	__le64 bytenr; /* this block number */
 	__le64 flags;
 
@@ -1174,9 +1174,9 @@ struct btrfs_super_block {
 	__le64 compat_ro_flags;
 	__le64 incompat_flags;
 	__le16 csum_type;
-	u8 root_level;
-	u8 chunk_root_level;
-	u8 log_root_level;
+	__u8 root_level;
+	__u8 chunk_root_level;
+	__u8 log_root_level;
 	struct btrfs_dev_item dev_item;
 
 	char label[BTRFS_LABEL_SIZE];
@@ -1185,11 +1185,11 @@ struct btrfs_super_block {
 	__le64 uuid_tree_generation;
 
 	/* The UUID written into btree blocks */
-	u8 metadata_uuid[BTRFS_FSID_SIZE];
+	__u8 metadata_uuid[BTRFS_FSID_SIZE];
 
 	/* Future expansion */
 	__le64 reserved[28];
-	u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
+	__u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
 	struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
 } __attribute__ ((__packed__));
 
@@ -1280,17 +1280,17 @@ struct btrfs_super_block {
 /* Every tree block (leaf or node) starts with this header. */
 struct btrfs_header {
 	/* These first four must match the super block */
-	u8 csum[BTRFS_CSUM_SIZE];
-	u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+	__u8 csum[BTRFS_CSUM_SIZE];
+	__u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
 	__le64 bytenr; /* Which block this node is supposed to live in */
 	__le64 flags;
 
 	/* Allowed to be different from the super from here on down. */
-	u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
+	__u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
 	__le64 generation;
 	__le64 owner;
 	__le32 nritems;
-	u8 level;
+	__u8 level;
 } __attribute__ ((__packed__));
 
 /*
Signature · 5 lines
2.25.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 6 lines · Stephen Rothwell

Hi all,

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

In file included from <command-line>:32:

Any extra info?

It builds fine in my environment, with older HEAD though.

Is there any new commits which changed <linux/types.h> header? As it should includes u8 typedef.

Thanks,
Qu

Quoted 160 lines

./usr/include/linux/btrfs_tree.h:1127:2: error: unknown type name 'u8'

 1127 |  u8 tree_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1128:2: error: unknown type name 'u8'
 1128 |  u8 chunk_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1129:2: error: unknown type name 'u8'
 1129 |  u8 extent_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1130:2: error: unknown type name 'u8'
 1130 |  u8 fs_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1131:2: error: unknown type name 'u8'
 1131 |  u8 dev_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1132:2: error: unknown type name 'u8'
 1132 |  u8 csum_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1134:2: error: unknown type name 'u8'
 1134 |  u8 unused_8[10];
      |  ^~
./usr/include/linux/btrfs_tree.h:1148:2: error: unknown type name 'u8'
 1148 |  u8 csum[BTRFS_CSUM_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1150:2: error: unknown type name 'u8'
 1150 |  u8 fsid[BTRFS_FSID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1177:2: error: unknown type name 'u8'
 1177 |  u8 root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1178:2: error: unknown type name 'u8'
 1178 |  u8 chunk_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1179:2: error: unknown type name 'u8'
 1179 |  u8 log_root_level;
      |  ^~
./usr/include/linux/btrfs_tree.h:1188:2: error: unknown type name 'u8'
 1188 |  u8 metadata_uuid[BTRFS_FSID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1192:2: error: unknown type name 'u8'
 1192 |  u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1283:2: error: unknown type name 'u8'
 1283 |  u8 csum[BTRFS_CSUM_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1284:2: error: unknown type name 'u8'
 1284 |  u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
      |  ^~
./usr/include/linux/btrfs_tree.h:1289:2: error: unknown type name 'u8'
 1289 |  u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
      |  ^~
./usr/include/linux/btrfs_tree.h:1293:2: error: unknown type name 'u8'
 1293 |  u8 level;
      |  ^~

Caused by commit

8d80a063d508 ("btrfs: move on-disk structure definitions to btrfs_tree.h")

They should probably all be __u8 ...

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Tue, 21 Apr 2020 10:19:20 +1000
Subject: [PATCH] btrfs: uapi headers should use __<type>

---
 include/uapi/linux/btrfs_tree.h | 36 ++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 18 deletions(-)
include/uapi/linux/btrfs_tree.h +18 -18
index a02318e4d2a9..1adf5971a966 100644
@@ -1124,14 +1124,14 @@ struct btrfs_root_backup {
 	/* future */
 	__le64 unused_64[4];
 
-	u8 tree_root_level;
-	u8 chunk_root_level;
-	u8 extent_root_level;
-	u8 fs_root_level;
-	u8 dev_root_level;
-	u8 csum_root_level;
+	__u8 tree_root_level;
+	__u8 chunk_root_level;
+	__u8 extent_root_level;
+	__u8 fs_root_level;
+	__u8 dev_root_level;
+	__u8 csum_root_level;
 	/* future and to align */
-	u8 unused_8[10];
+	__u8 unused_8[10];
 } __attribute__ ((__packed__));
 
 /*
@@ -1145,9 +1145,9 @@ struct btrfs_root_backup {
 /* The super block basically lists the main trees of the FS. */
 struct btrfs_super_block {
 	/* The first 4 fields must match struct btrfs_header */
-	u8 csum[BTRFS_CSUM_SIZE];
+	__u8 csum[BTRFS_CSUM_SIZE];
 	/* FS specific UUID, visible to user */
-	u8 fsid[BTRFS_FSID_SIZE];
+	__u8 fsid[BTRFS_FSID_SIZE];
 	__le64 bytenr; /* this block number */
 	__le64 flags;
 
@@ -1174,9 +1174,9 @@ struct btrfs_super_block {
 	__le64 compat_ro_flags;
 	__le64 incompat_flags;
 	__le16 csum_type;
-	u8 root_level;
-	u8 chunk_root_level;
-	u8 log_root_level;
+	__u8 root_level;
+	__u8 chunk_root_level;
+	__u8 log_root_level;
 	struct btrfs_dev_item dev_item;
 
 	char label[BTRFS_LABEL_SIZE];
@@ -1185,11 +1185,11 @@ struct btrfs_super_block {
 	__le64 uuid_tree_generation;
 
 	/* The UUID written into btree blocks */
-	u8 metadata_uuid[BTRFS_FSID_SIZE];
+	__u8 metadata_uuid[BTRFS_FSID_SIZE];
 
 	/* Future expansion */
 	__le64 reserved[28];
-	u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
+	__u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
 	struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
 } __attribute__ ((__packed__));
 
@@ -1280,17 +1280,17 @@ struct btrfs_super_block {
 /* Every tree block (leaf or node) starts with this header. */
 struct btrfs_header {
 	/* These first four must match the super block */
-	u8 csum[BTRFS_CSUM_SIZE];
-	u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+	__u8 csum[BTRFS_CSUM_SIZE];
+	__u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
 	__le64 bytenr; /* Which block this node is supposed to live in */
 	__le64 flags;
 
 	/* Allowed to be different from the super from here on down. */
-	u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
+	__u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
 	__le64 generation;
 	__le64 owner;
 	__le32 nritems;
-	u8 level;
+	__u8 level;
 } __attribute__ ((__packed__));
 
 /*
#2 lore raw

Hi Qu,

Quoted 10 lines · On Tue, 21 Apr 2020 08:40:45 +0800 Qu Wenruo <[email protected]> wrote:
Quoted 6 lines · Stephen Rothwell

Hi all,

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

In file included from <command-line>:32:

Any extra info?

That is a build test of the uapi headers to make syre that they are self contained.

Quoted 4 lines

It builds fine in my environment, with older HEAD though.

Is there any new commits which changed <linux/types.h> header? As it should includes u8 typedef.

My understanding is that you should only use the __ versions of the kernel types in uapi headers to avoid namespace contamination.

Signature · 2 lines
Cheers,
Stephen Rothwell
#3 lore raw
Quoted 10 lines · Stephen Rothwell

Hi Qu,

Quoted 7 lines · On Tue, 21 Apr 2020 08:40:45 +0800 Qu Wenruo <[email protected]> wrote:
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

In file included from <command-line>:32:

Any extra info?

That is a build test of the uapi headers to make syre that they are self contained.

Any command to reproduce it?
As I want to avoid such problem in future development.

Quoted 9 lines
Quoted 5 lines

It builds fine in my environment, with older HEAD though.

Is there any new commits which changed <linux/types.h> header? As it should includes u8 typedef.

My understanding is that you should only use the __ versions of the kernel types in uapi headers to avoid namespace contamination.

Thanks for the hint,
Qu

#4 lore raw

Hi Qu,

Quoted 8 lines · On Tue, 21 Apr 2020 09:33:56 +0800 Qu Wenruo <[email protected]> wrote:
Quoted 3 lines · Stephen Rothwell

That is a build test of the uapi headers to make syre that they are self contained.

Any command to reproduce it?
As I want to avoid such problem in future development.

You need to enable CONFIG_UAPI_HEADER_TEST (which allmodconfig does).

Signature · 2 lines
Cheers,
Stephen Rothwell
#5 lore raw
In reply to Stephen Rothwell
Quoted 10 lines · Stephen Rothwell

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Caused by commit

8d80a063d508 ("btrfs: move on-disk structure definitions to btrfs_tree.h")

They should probably all be __u8 ...

I have applied the following patch for today.

I've removed the patch from the for-next branch.

#6 lore raw
Quoted 6 lines · David Sterba
Quoted 5 lines · Stephen Rothwell

After merging the btrfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Caused by commit

Quoted 8 lines
Quoted 5 lines

8d80a063d508 ("btrfs: move on-disk structure definitions to btrfs_tree.h")

They should probably all be __u8 ...

I have applied the following patch for today.

I've removed the patch from the for-next branch.

BTW, do I need to update the patch, or just move btrfs_tree.h to fs/btrfs?

Thanks,
Qu