]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: make 1-bit bit-fields of scrub_page unsigned int
authorColin Ian King <colin.i.king@googlemail.com>
Wed, 10 Nov 2021 19:20:08 +0000 (19:20 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:34:11 +0000 (07:34 +0100)
BugLink: https://bugs.launchpad.net/bugs/1952579
[ Upstream commit d08e38b62327961295be1c63b562cd46ec97cd07 ]

The bitfields have_csum and io_error are currently signed which is not
recommended as the representation is an implementation defined
behaviour. Fix this by making the bit-fields unsigned ints.

Fixes: 2c36395430b0 ("btrfs: scrub: remove the anonymous structure from scrub_page")
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/btrfs/scrub.c

index 088641ba7a8e6d19ad604d669905697814d1f719..62f4bafbe54bb273036937cd77bce9d01e4c5d1c 100644 (file)
@@ -73,8 +73,8 @@ struct scrub_page {
        u64                     physical_for_dev_replace;
        atomic_t                refs;
        u8                      mirror_num;
-       int                     have_csum:1;
-       int                     io_error:1;
+       unsigned int            have_csum:1;
+       unsigned int            io_error:1;
        u8                      csum[BTRFS_CSUM_SIZE];
 
        struct scrub_recover    *recover;