btrfs-progs/check
Nikolay Borisov c08983291e btrfs-progs: check: fix error reporting on root inode
If btrfs check detects an error on the root inode of a subvolume it
prints:

    Opening filesystem to check...
    Checking filesystem on /dev/vdc
    UUID: 4ac7a216-bf97-4c5f-9899-0f203c20d8af
    [1/7] checking root items
    [2/7] checking extents
    [3/7] checking free space cache
    [4/7] checking fs roots
    root 5 root dir 256 error
    ERROR: errors found in fs roots
    found 196608 bytes used, error(s) found
    total csum bytes: 0
    total tree bytes: 131072
    total fs tree bytes: 32768
    total extent tree bytes: 16384
    btree space waste bytes: 124376
    file data blocks allocated: 65536
     referenced 65536

This is not very helpful since there is no specific information about
the exact error. This is due to the fact that check_root_dir doesn't
set inode_record::errors accordingly. This patch rectifies this and now
the output would look like:

	[1/7] checking root items
	[2/7] checking extents
	[3/7] checking free space cache
	[4/7] checking fs roots
	root 5 inode 256 errors 2000, link count wrong
	ERROR: errors found in fs roots
	found 196608 bytes used, error(s) found
	total csum bytes: 0
	total tree bytes: 131072
	total fs tree bytes: 32768
	total extent tree bytes: 16384
	btree space waste bytes: 124376
	file data blocks allocated: 65536
	 referenced 65536

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-08-31 17:16:36 +02:00
..
common.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
main.c btrfs-progs: check: fix error reporting on root inode 2020-08-31 17:16:36 +02:00
mode-common.c btrfs-progs: move transaction.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
mode-common.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
mode-lowmem.c btrfs-progs: check/lowmem: add inode transid detect and repair support 2020-08-31 17:09:55 +02:00
mode-lowmem.h btrfs-progs: check: drop unused fs_info 2020-08-31 17:01:03 +02:00
mode-original.h
qgroup-verify.c btrfs-progs: move transaction.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
qgroup-verify.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00