mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-19 19:26:51 +00:00
[BUG] With valgrind, fsck/002 test with original mode would report the following valgrind error: ==90600== Conditional jump or move depends on uninitialised value(s) ==90600== at 0x15C280: pick_next_pending (main.c:4949) ==90600== by 0x15F3CF: run_next_block (main.c:6175) ==90600== by 0x1655CC: deal_root_from_list (main.c:8486) ==90600== by 0x1660C7: check_chunks_and_extents (main.c:8762) ==90600== by 0x166439: do_check_chunks_and_extents (main.c:8842) ==90600== by 0x169D0B: cmd_check (main.c:10324) ==90600== by 0x11CDC6: cmd_execute (commands.h:125) ==90600== by 0x11D712: main (btrfs.c:386) [CAUSE] The problem happens like this: deal_root_from_list(@list is empty) |- stack @last is not initialized |- while(!list_empty(list)) {} is skipped |- run_next_block(&last); |- pick_next_pending(*last); |- node_start = last; Since the stack @last is not initialized in deal_root_from_list(), the final node_start = last assignment would just fetch the garbage from stack. [FIX] Fix the problem by initializing @last to 0, as that's exactly what the first while loop did. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
common.h | ||
main.c | ||
mode-common.c | ||
mode-common.h | ||
mode-lowmem.c | ||
mode-lowmem.h | ||
mode-original.h | ||
qgroup-verify.c | ||
qgroup-verify.h |