btrfs: fix uninitialized variable warning in btrfs_update_block_group
authorJosef Bacik <josef@toxicpanda.com>
Fri, 16 Dec 2022 20:15:54 +0000 (15:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:42 +0000 (12:10 +0200)
[ Upstream commit efbf35a102b20246cfe4409c6ae92e72ecb67ab8 ]

reclaim isn't set in the alloc case, however we only care about
reclaim in the !alloc case.  This isn't an actual problem, however
-Wmaybe-uninitialized will complain, so initialize reclaim to quiet the
compiler.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: df384da5a49c ("btrfs: use temporary variable for space_info in btrfs_update_block_group")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/block-group.c

index 4b69945755e4fa269a0e81c154bd4aae3c1a3f91..380cb10f0d37b0ce99653a33cf05f24d57ca5be7 100644 (file)
@@ -3259,7 +3259,7 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans,
        spin_unlock(&info->delalloc_root_lock);
 
        while (total) {
-               bool reclaim;
+               bool reclaim = false;
 
                cache = btrfs_lookup_block_group(info, bytenr);
                if (!cache) {