btrfs-progs: fix a variable shadowing when enabling experimental features

There is another variable shadowing problem which can only be exposed
if experimental features are enabled.

Inside the branch of BTRFS_PRINT_TREE_CSUM_HEADERS, we declare another
local variable @csum, shadowing the @csum of print_header_info(), which
is only declared when experimental features are enabled.

Just rename the @csum to @tree_csum to avoid the problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2023-09-28 13:36:34 +09:30 committed by David Sterba
parent c94965198a
commit 93e8b661f6

View File

@ -1311,12 +1311,12 @@ static void print_header_info(struct extent_buffer *eb, unsigned int mode)
printf("\n");
if (fs_info && (mode & BTRFS_PRINT_TREE_CSUM_HEADERS)) {
char *tmp = csum_str;
u8 *csum = (u8 *)(eb->data + offsetof(struct btrfs_header, csum));
u8 *tree_csum = (u8 *)(eb->data + offsetof(struct btrfs_header, csum));
strcpy(csum_str, " csum 0x");
tmp = csum_str + strlen(csum_str);
for (i = 0; i < csum_size; i++) {
sprintf(tmp, "%02x", csum[i]);
sprintf(tmp, "%02x", tree_csum[i]);
tmp++;
tmp++;
}