btrfs-progs/kernel-shared
Anand Jain f16be8eeb7 btrfs-progs: fix may be used uninitialized in __set_extent_bit
Compiler is throwing out this false positive warning in the following
function flow. Apparently, %parent and %p are initialized in tree_search_for_insert().

  __set_extent_bit()
  state = tree_search_for_insert(tree, start, &p, &parent);
  insert_state_fast(tree, prealloc, p, parent, bits, changeset);
   rb_link_node(&state->rb_node, parent, node);

Compile warnings:

In file included from ./common/extent-cache.h:23,
                 from kernel-shared/ctree.h:26,
                 from kernel-shared/extent-io-tree.c:4:
kernel-shared/extent-io-tree.c: In function ‘__set_extent_bit’:
./kernel-lib/rbtree.h:80:28: warning: ‘parent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  node->__rb_parent_color = (unsigned long)parent;
                            ^~~~~~~~~~~~~~~~~~~~~
kernel-shared/extent-io-tree.c:996:18: note: ‘parent’ was declared here
  struct rb_node *parent;
                  ^~~~~~
In file included from ./common/extent-cache.h:23,
                 from kernel-shared/ctree.h:26,
                 from kernel-shared/extent-io-tree.c:4:
./kernel-lib/rbtree.h:83:11: warning: ‘p’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  *rb_link = node;
  ~~~~~~~~~^~~~~~
kernel-shared/extent-io-tree.c:995:19: note: ‘p’ was declared here
  struct rb_node **p;

Fix:

 Initialize to NULL, as in the kernel.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-05-26 18:02:31 +02:00
..
uapi btrfs-progs: sync on-disk definitions from the kernel header 2023-05-26 18:02:28 +02:00
accessors.c btrfs-progs: sync accessors.[ch] from the kernel 2023-05-26 18:02:28 +02:00
accessors.h btrfs-progs: sync accessors.[ch] from the kernel 2023-05-26 18:02:28 +02:00
async-thread.c btrfs-progs: sync async-thread.[ch] from the kernel 2023-05-26 18:02:29 +02:00
async-thread.h btrfs-progs: sync async-thread.[ch] from the kernel 2023-05-26 18:02:29 +02:00
backref.c btrfs-progs: update read_tree_block to match the kernel definition 2023-05-26 18:02:30 +02:00
backref.h btrfs-progs: move extent_io.c to kernel-shared/ 2020-08-31 17:01:04 +02:00
compression.h btrfs-progs: kerncompat: hide definition of __init 2023-01-03 17:24:36 +01:00
ctree.c btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
ctree.h btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
delayed-ref.c btrfs-progs: sync messages.[ch] from the kernel 2023-05-26 18:02:28 +02:00
delayed-ref.h btrfs-progs: unify GPL header comments 2021-09-07 13:58:44 +02:00
dir-item.c btrfs-progs: sync accessors.[ch] from the kernel 2023-05-26 18:02:28 +02:00
disk-io.c btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
disk-io.h btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
extent_io.c btrfs-progs: add btrfs_readahead_node_child helper 2023-05-26 18:02:30 +02:00
extent_io.h btrfs-progs: add btrfs_readahead_node_child helper 2023-05-26 18:02:30 +02:00
extent-io-tree.c btrfs-progs: fix may be used uninitialized in __set_extent_bit 2023-05-26 18:02:31 +02:00
extent-io-tree.h btrfs-progs: sync extent-io-tree.[ch] and misc.h from the kernel 2023-05-26 18:02:29 +02:00
extent-tree.c btrfs-progs: add an atomic parameter to btrfs_buffer_uptodate 2023-05-26 18:02:30 +02:00
file-item.c btrfs-progs: sync file-item.h into progs 2023-05-26 18:02:29 +02:00
file-item.h btrfs-progs: sync file-item.h into progs 2023-05-26 18:02:29 +02:00
file.c btrfs-progs: sync file-item.h into progs 2023-05-26 18:02:29 +02:00
free-space-cache.c btrfs-progs: remove root argument from free_extent and inc_extent_ref 2023-05-26 18:02:30 +02:00
free-space-cache.h btrfs-progs: check: batch v1 space cache inodes when clearing 2021-07-22 16:26:05 +02:00
free-space-tree.c btrfs-progs: sync messages.[ch] from the kernel 2023-05-26 18:02:28 +02:00
free-space-tree.h btrfs-progs: properly initialize block group thresholds 2022-05-20 15:54:20 +02:00
inode-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
inode.c btrfs-progs: sync accessors.[ch] from the kernel 2023-05-26 18:02:28 +02:00
locking.c btrfs-progs: sync locking.h and stub out all the helpers 2023-05-26 18:02:29 +02:00
locking.h btrfs-progs: sync locking.h and stub out all the helpers 2023-05-26 18:02:29 +02:00
messages.c btrfs-progs: add musl compatibility for printf format %pV 2023-05-26 18:02:28 +02:00
messages.h btrfs-progs: sync messages.[ch] from the kernel 2023-05-26 18:02:28 +02:00
misc.h btrfs-progs: sync extent-io-tree.[ch] and misc.h from the kernel 2023-05-26 18:02:29 +02:00
print-tree.c btrfs-progs: update read_tree_block to match the kernel definition 2023-05-26 18:02:30 +02:00
print-tree.h btrfs-progs: dump-tree: add options to dump checksums 2021-06-19 22:07:49 +02:00
root-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
send.h btrfs-progs: receive: add support for fs-verity 2022-10-11 09:08:08 +02:00
transaction.c btrfs-progs: rename clear_extent_buffer_dirty to btrfs_clear_buffer_dirty 2023-05-26 18:02:29 +02:00
transaction.h btrfs-progs: move transaction.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
tree-checker.c btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
tree-checker.h btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
tree-mod-log.h btrfs-progs: sync and stub-out tree-mod-log.h 2023-05-26 18:02:29 +02:00
ulist.c btrfs-progs: fix -Wmissing-prototypes warnings 2023-05-26 18:02:31 +02:00
ulist.h btrfs-progs: unify GPL header comments 2021-09-07 13:58:44 +02:00
uuid-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
volumes.c btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
volumes.h btrfs-progs: sync tree-checker.[ch] from kernel 2023-05-26 18:02:30 +02:00
zoned.c btrfs-progs: fix -Wmissing-prototypes warnings 2023-05-26 18:02:31 +02:00
zoned.h btrfs-progs: sync messages.[ch] from the kernel 2023-05-26 18:02:28 +02:00