btrfs-progs/check
Qu Wenruo 87b3197d81 btrfs-progs: move space cache removal to rescue group
The option "--clear-space-cache" is not really that suitable for "btrfs
check" group, as there are some concerns:

- Allowing transid mismatch
- No leaf item checks

  Thoe behaviour are inherited from the default open ctree flags for
  "btrfs check", which can be unsafe if the end user just wants to clear
  the cache.

- Unclear if the cache clearing would happen along with repair

  Thankfully the clearing of space cache is done without any repair

Thus there is a proposal to move space cache removal to rescue group,
and this patch would do that exactly.

However this would lead to some behavior changes:

- Transid mismatch would be treated as error
- Leaf items size/offset would still be checked

  If we hit any above error, we should just abort without doing any
  write.

These change would increase the safety of the space cache removal, thus
I believe it's worthy to introduce such behavior change.

Since we're here, also add a small explanation on why we need this
dedicated tool to clear space cache (especially for v1 cache).

Issue: #698
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
..
common.h btrfs-progs: sync extent-io-tree.[ch] and misc.h from the kernel 2023-05-26 18:02:29 +02:00
main.c btrfs-progs: move space cache removal to rescue group 2023-11-03 18:04:37 +01:00
mode-common.c btrfs-progs: check: drop unsigned long long casts for printf 2023-11-03 18:04:37 +01:00
mode-common.h btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
mode-lowmem.c btrfs-progs: check: lowmem, verify the sequence of inline backref items 2023-11-03 18:04:31 +01:00
mode-lowmem.h btrfs-progs: check: update error bit definitions 2023-11-03 18:04:37 +01:00
mode-original.h btrfs-progs: check: update error bit definitions 2023-11-03 18:04:37 +01:00
qgroup-verify.c btrfs-progs: check: drop unsigned long long casts for printf 2023-11-03 18:04:37 +01:00
qgroup-verify.h btrfs-progs: check: update include lists 2022-10-11 09:06:12 +02:00
repair.c btrfs-progs: fix all variable shadowing 2023-10-10 19:16:29 +02:00
repair.h btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00