btrfs-progs/check
Qu Wenruo 0ebd1f47c5 btrfs-progs: check: add the ability to reset btrfs_dev_item::bytes_used
There is a report from the mailing list that one user got its filesystem
with device item bytes_used mismatch.

This problem leaves the device item with some ghost bytes_used, meaning
even if we delete all device extents of that device, the bytes_used
still won't be 0.

This itself is not a big deal, but when the user used up all its
unallocated space, write time tree-checker can be triggered and make the
fs RO, as the new device::bytes_used can be larger than
device::total_bytes.

Thus we need to fix the problem in btrfs-check to avoid above write-time
tree check warning.

This patch will add the ability to reset a device's bytes_used to both
original mode and lowmem mode.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-06-19 22:07:49 +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: add the ability to reset btrfs_dev_item::bytes_used 2021-06-19 22:07:49 +02:00
mode-common.c btrfs-progs: check: add the ability to reset btrfs_dev_item::bytes_used 2021-06-19 22:07:49 +02:00
mode-common.h btrfs-progs: check: add the ability to reset btrfs_dev_item::bytes_used 2021-06-19 22:07:49 +02:00
mode-lowmem.c btrfs-progs: check: add the ability to reset btrfs_dev_item::bytes_used 2021-06-19 22:07:49 +02:00
mode-lowmem.h btrfs-progs: check: drop unused fs_info 2020-08-31 17:01:03 +02:00
mode-original.h btrfs-progs: check/original: Add check and repair for invalid inode generation 2019-11-18 19:21:07 +01:00
qgroup-verify.c btrfs-progs: move repair.[ch] to common/ 2021-05-06 16:41:47 +02:00
qgroup-verify.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00