On Fri, Jul 10, 2020 at 11:05:09PM +0900, Johannes Thumshirn wrote:
> @@ -261,7 +264,8 @@ struct btrfs_ioctl_fs_info_args {
> __u32 flags; /* in/out */
> __u16 csum_type; /* out */
> __u16 csum_size; /* out */
> - __u8 reserved[972]; /* pad to 1k */
> + __u32 generation; /* out */
> + __u8 reserved[968]; /* pad to 1k */
I've tested the static assert by switching just the type but not the
remaining reserved bytes
./include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct btrfs_ioctl_fs_info_args) == 1024"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
./include/linux/build_bug.h:77:34: note: in expansion of macro ‘__static_assert’
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
./include/uapi/linux/btrfs.h:270:1: note: in expansion of macro ‘static_assert’
270 | static_assert(sizeof(struct btrfs_ioctl_fs_info_args) == 1024);
| ^~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:281: fs/btrfs/super.o] Error 1
make[1]: *** [scripts/Makefile.build:497: fs/btrfs] Error 2
make: *** [Makefile:1756: fs] Error 2
Good.