@@ -1271,12 +1271,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++;
}
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> --- kernel-shared/print-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)