btrfs-progs/check
Qu Wenruo 48248693cd btrfs-progs: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check.
In lowmem mode, we check fs roots and free space cache by iterating
each root item and inode item, using btrfs_next_item() and a path
pointing to the root tree.

However in repair mode, check_fs_root() can modify the fs root, thus
CoWs the tree root, and the old path in check_fs

It could lead to strange behavior, e.g. after repairing a fs tree, the
path can point to a fs tree.
Since no ROOT_ITEM exists in fs tree, all remaining trees are skipped in
repair mode.

This bug exists from the early time of lowmem mode repair, and is only
exposed by recent free space inode check code. (Fs tree inodes are
passed to free space inode check, causing false alerts and repair
failure).

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-06-05 18:02:05 +02:00
..
main.c btrfs-progs: Cleanup BTRFS_COMPAT_EXTENT_TREE_V0 2019-06-05 18:00:07 +02:00
mode-common.c btrfs-progs: check/lowmem: Check and repair free space cache inode mode 2019-04-16 09:04:25 +08: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: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check. 2019-06-05 18:02:05 +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: check/original: Add inode mode check 2019-04-16 09:04:25 +08:00