linux-next: build warnings after merge of the btrfs tree
Hi all,
After merging the btrfs tree, today's linux-next build (powerpc ppc64_defconfig) produced these warnings:
In file included from include/linux/swab.h:5,
from include/uapi/linux/byteorder/big_endian.h:14,
from include/linux/byteorder/big_endian.h:5,
from arch/powerpc/include/uapi/asm/byteorder.h:14,
from include/asm-generic/bitops/le.h:6,
from arch/powerpc/include/asm/bitops.h:336,
from include/linux/bitops.h:68,
from fs/btrfs/extent_io.c:3:
In function 'btrfs_disk_key_to_cpu',
inlined from 'btrfs_item_key_to_cpu' at fs/btrfs/accessors.h:648:2,
inlined from 'fiemap_find_last_extent_offset' at fs/btrfs/extent_io.c:2804:2,
inlined from 'extent_fiemap' at fs/btrfs/extent_io.c:2879:8:include/uapi/linux/swab.h:128:28: warning: 'disk_key.objectid' may be used uninitialized [-Wmaybe-uninitialized]
128 | #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/big_endian.h:33:26: note: in expansion of macro '__swab64'
33 | #define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
| ^~~~~~~~
include/linux/byteorder/generic.h:87:21: note: in expansion of macro '__le64_to_cpu'
87 | #define le64_to_cpu __le64_to_cpu
| ^~~~~~~~~~~~~
fs/btrfs/accessors.h:622:25: note: in expansion of macro 'le64_to_cpu'
622 | cpu->objectid = le64_to_cpu(disk->objectid);
| ^~~~~~~~~~~In file included from fs/btrfs/extent_io.c:34:fs/btrfs/accessors.h: In function 'extent_fiemap':fs/btrfs/accessors.h:645:31: note: 'disk_key.objectid' was declared here
645 | struct btrfs_disk_key disk_key;
| ^~~~~~~~
In function 'fiemap_find_last_extent_offset',
inlined from 'extent_fiemap' at fs/btrfs/extent_io.c:2879:8:fs/btrfs/extent_io.c:2805:33: warning: 'disk_key.type' may be used uninitialized [-Wmaybe-uninitialized]
2805 | if (key.objectid != ino || key.type != BTRFS_EXTENT_DATA_KEY) {fs/btrfs/accessors.h: In function 'extent_fiemap':fs/btrfs/accessors.h:645:31: note: 'disk_key.type' was declared here
645 | struct btrfs_disk_key disk_key;
| ^~~~~~~~
I don't really have any idea what caused this (it *may* have been my change from gcc v12 to v13?).
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 43 lines · Stephen Rothwell
Hi all,
After merging the btrfs tree, today's linux-next build (powerpc
ppc64_defconfig) produced these warnings:In file included from
include/linux/swab.h:5,
frominclude/uapi/linux/byteorder/big_endian.h:14,
frominclude/linux/byteorder/big_endian.h:5,
fromarch/powerpc/include/uapi/asm/byteorder.h:14,
frominclude/asm-generic/bitops/le.h:6,
fromarch/powerpc/include/asm/bitops.h:336,
frominclude/linux/bitops.h:68,
fromfs/btrfs/extent_io.c:3:
In function 'btrfs_disk_key_to_cpu',
inlined from 'btrfs_item_key_to_cpu' atfs/btrfs/accessors.h:648:2,
inlined from 'fiemap_find_last_extent_offset' atfs/btrfs/extent_io.c:2804:2,
inlined from 'extent_fiemap' atfs/btrfs/extent_io.c:2879:8:include/uapi/linux/swab.h:128:28: warning: 'disk_key.objectid' may be used uninitialized [-Wmaybe-uninitialized]
128 | #define__swab64(x)(__u64)__builtin_bswap64((__u64)(x))| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/uapi/linux/byteorder/big_endian.h:33:26: note: in expansion of macro '__swab64' 33 | #define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x)) | ^~~~~~~~ include/linux/byteorder/generic.h:87:21: note: in expansion of macro '__le64_to_cpu' 87 | #define le64_to_cpu __le64_to_cpu | ^~~~~~~~~~~~~ fs/btrfs/accessors.h:622:25: note: in expansion of macro 'le64_to_cpu' 622 | cpu->objectid = le64_to_cpu(disk->objectid); | ^~~~~~~~~~~In file included from
fs/btrfs/extent_io.c:34:fs/btrfs/accessors.h: In function 'extent_fiemap':fs/btrfs/accessors.h:645:31: note: 'disk_key.objectid' was declared here
645 | structbtrfs_disk_keydisk_key;
| ^~~~~~~~
In function 'fiemap_find_last_extent_offset',
inlined from 'extent_fiemap' atfs/btrfs/extent_io.c:2879:8:fs/btrfs/extent_io.c:2805:33: warning: 'disk_key.type' may be used uninitialized [-Wmaybe-uninitialized]
2805 | if (key.objectid != ino || key.type !=BTRFS_EXTENT_DATA_KEY) {fs/btrfs/accessors.h: In function 'extent_fiemap':fs/btrfs/accessors.h:645:31: note: 'disk_key.type' was declared here
645 | structbtrfs_disk_keydisk_key;
| ^~~~~~~~
Quoted 2 lines
I don't really have any idea what caused this (it *may* have been my change from gcc v12 to v13?).
I tried 12 and 13, no warnings on x86_64, however the report is on powerpc. If this is on a big endian host it could be a valid warning, we have an optmization where the on-disk format endianity matches CPU (little endian) then the structures btrfs_disk_key and btrfs_key are equivalent and no coversion is needed.
There were some changes that might be related and newly added to for-next so we don't have any other reference point, I'll take a look.
Hi David,
Quoted 9 lines · On Tue, 12 Sep 2023 13:20:11 +0200 David Sterba <[email protected]> wrote:
I tried 12 and 13, no warnings on
x86_64, however the report is on powerpc. If this is on a big endian host it could be a valid warning, we have an optmization where the on-disk format endianity matches CPU (little endian) then the structuresbtrfs_disk_keyandbtrfs_keyare equivalent and no coversion is needed.There were some changes that might be related and newly added to for-next so we don't have any other reference point, I'll take a look.
This is indeed a big endian build (big endian cross build on a little endian host). I also did *not* get these warnings on my x86_64 build.
Signature · 2 lines
Cheers, Stephen Rothwell
Hi Stephen,
Quoted 11 lines · On Tue, 12 Sep 2023 22:20:06 +1000 Stephen Rothwell <[email protected]>…
Hi David,
Quoted 7 lines · On Tue, 12 Sep 2023 13:20:11 +0200 David Sterba <[email protected]> wrote:
I tried 12 and 13, no warnings on
x86_64, however the report is on powerpc. If this is on a big endian host it could be a valid warning, we have an optmization where the on-disk format endianity matches CPU (little endian) then the structuresbtrfs_disk_keyandbtrfs_keyare equivalent and no coversion is needed.
Quoted 5 lines
Quoted 2 lines
There were some changes that might be related and newly added to for-next so we don't have any other reference point, I'll take a look.
This is indeed a big endian build (big endian cross build on a little endian host). I also did *not* get these warnings on my
x86_64build.
But I do get them from my s390 defconfig build. Any progress?
Signature · 2 lines
Cheers, Stephen Rothwell