btrfs-progs/check
Qu Wenruo fd500029eb btrfs-progs: check: fix two error messages used in qgroup verification
[BUG]
There is a weird error message when running btrfs check on a specific
image:

  [7/7] checking quota groups
  ERROR: out of memory
  ERROR: Loading qgroups from disk: -2
  ERROR: failed to check quota groups

[CAUSE]
The "Out of memory" one is in load_quota_info(), which is output in two
cases:

- No memory can be allocated for btrfs_qgroup_list
  AKA, real -ENOMEM.

- No qgroup can be found for either the child or the parent qgroup
  This returnes -ENOENT.

Obvious the image has hit -ENOENT case, but the error message is fixed
to ENOMEM case.

[FIX]
Fix it by using %m to output the real reason of failure.

Reported-by: Andrei Borzenkov <arvidjaar@gmail.com>
Link: https://forums.opensuse.org/showthread.php/567851-btrfs-fails-to-load-qgroups-from-disk-with-error-2-(out-of-memory)
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-03-23 18:18:31 +01:00
..
btrfsck.h btrfs-progs: libbtrfs: remove unneeded BTRFS_FLAT_INCLUDES protections 2021-10-08 20:47:03 +02:00
common.h btrfs-progs: check: detect and fix invalid used for block groups 2021-08-25 15:38:54 +02:00
main.c btrfs-progs: check: don't do the root item check for extent tree v2 2022-03-09 18:07:34 +01:00
mode-common.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
mode-common.h btrfs-progs: check: move csum tree population into mode-common.[ch] 2022-02-01 18:41:13 +01:00
mode-lowmem.c btrfs-progs: check: add block group tree support 2022-03-09 18:07:04 +01:00
mode-lowmem.h btrfs-progs: check btrfs_super_used in lowmem check 2021-08-25 15:38:54 +02:00
mode-original.h btrfs-progs: use btrfs_key for btrfs_check_node() and btrfs_check_leaf() 2021-09-07 13:58:44 +02:00
qgroup-verify.c btrfs-progs: check: fix two error messages used in qgroup verification 2022-03-23 18:18:31 +01:00
qgroup-verify.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00