btrfs-progs/check
Naohiro Aota 8ca6c0c3c7 btrfs-progs: check: initialize qgroup_item_count in earlier stage
"btrfsck -Q" segfaults because it does not call qgroup_set_item_count_ptr()
properly:

  # btrfsck -Q /dev/sdk
  Opening filesystem to check...
  Checking filesystem on /dev/sdk
  UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3
  Print quota groups for /dev/sdk
  UUID: 34a35bbc-43f8-40f0-8043-65ed33f2e6c3
  Segmentation fault (core dumped)

Since "struct task_ctx ctx" is global, we can just move
qgroup_set_item_count_ptr() much earlier stage in the check process to
avoid to forget initializing it.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-26 17:46:42 +02:00
..
main.c btrfs-progs: check: initialize qgroup_item_count in earlier stage 2019-07-26 17:46:42 +02:00
mode-common.c btrfs-progs: move utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
mode-common.h btrfs-progs: check/lowmem: Check and repair free space cache inode mode 2019-04-16 09:04:25 +08:00
mode-lowmem.c btrfs-progs: move utils.[ch] to common/ 2019-07-03 20:49:04 +02:00
mode-lowmem.h btrfs-progs: check/lowmem: Check and repair free space cache inode mode 2019-04-16 09:04:25 +08:00
mode-original.h btrfs-progs: move rbtree-utils.[ch] to common/ 2019-07-03 20:49:04 +02:00