btrfs-progs/kernel-shared
Qu Wenruo 6c7a6dba95 btrfs-progs: use alloc_dummy_extent_buffer() for temporary super block
[FALSE ALERT]
There is a false alert when compiling btrfs-progs using gcc 12.2.1:

  $ make D=1
  kernel-shared/print-tree.c: In function 'print_sys_chunk_array':
  kernel-shared/print-tree.c:1797:9: warning: 'buf' may be used uninitialized [-Wmaybe-uninitialized]
   1797 |         write_extent_buffer(buf, sb, 0, sizeof(*sb));
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from ./kernel-shared/ctree.h:27,
                   from kernel-shared/print-tree.c:24:
  ./kernel-shared/extent_io.h:148:6: note: by argument 1 of type 'const struct extent_buffer *' to 'write_extent_buffer' declared here
    148 | void write_extent_buffer(const struct extent_buffer *eb, const void *src,
        |      ^~~~~~~~~~~~~~~~~~~

[CAUSE]
This is a false alert, the uninitialized part of buf will not be
utilized at all during write_extent_buffer().

[FIX]
Instead of allocating such ad-hoc buffer, go a more formal way by
calling alloc_dummy_extent_buffer(), which would properly set all
the members.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-03-21 03:10:42 +01:00
..
backref.c
backref.h
compression.h btrfs-progs: kerncompat: hide definition of __init 2023-01-03 17:24:36 +01:00
ctree.c btrfs-progs: tune: update checksum conversion 2023-02-28 20:11:22 +01:00
ctree.h btrfs-progs: tune: update checksum conversion 2023-02-28 20:11:22 +01:00
delayed-ref.c
delayed-ref.h
dir-item.c
disk-io.c btrfs-progs: tune: update checksum conversion 2023-02-28 20:11:22 +01:00
disk-io.h
extent-tree.c btrfs-progs: fix a false alert on an uninitialized variable when BUG_ON() is involved 2023-02-18 17:44:02 +01:00
extent_io.c btrfs-progs: make write_extent_buffer take a const eb 2022-11-30 19:14:29 +01:00
extent_io.h btrfs-progs: make write_extent_buffer take a const eb 2022-11-30 19:14:29 +01:00
file-item.c
file.c
free-space-cache.c
free-space-cache.h
free-space-tree.c
free-space-tree.h
inode-item.c
inode.c
print-tree.c btrfs-progs: use alloc_dummy_extent_buffer() for temporary super block 2023-03-21 03:10:42 +01:00
print-tree.h
root-tree.c
send.h
transaction.c
transaction.h
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs-progs: fix a false alert on an uninitialized variable when BUG_ON() is involved 2023-02-18 17:44:02 +01:00
volumes.h
zoned.c btrfs-progs: fix set but not used variables 2023-02-18 17:44:03 +01:00
zoned.h