btrfs-progs/tune
Qu Wenruo 6a3e646139 btrfs-progs: change-csum: handle finished dev-replace correctly
[BUG]
If a btrfs filesystem had dev-replace ran in the past, even it's already
finished, btrfstune would refuse to change its csum:

  WARNING: Experimental build with unstable or unfinished features
  WARNING: Switching checksums is experimental, do not use for valuable data!

  Proceed to switch checksums
  ERROR: running dev-replace detected, please finish or cancel it.
  ERROR: btrfstune failed

[CAUSE]
The current dev-replace detection is only checking if we have
DEV_REPLACE item in device tree.
However DEV_REPLACE item will also exist even if a dev-replace finished,
so the existing check can not handle such case at all.

[FIX]
If an dev-replace item is found, further check the state of the item to
prevent false alerts.

Issue: #798
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2024-06-03 21:59:43 +02:00
..
change-csum.c btrfs-progs: change-csum: handle finished dev-replace correctly 2024-06-03 21:59:43 +02:00
change-metadata-uuid.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
change-uuid.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
convert-bgt.c btrfs-progs: tune: add the missing newline for --convert-from-block-group-tree 2024-04-02 20:49:55 +02:00
main.c btrfs-progs: tune: fix btrfstune --help for -m -M option 2024-05-17 17:36:59 +02:00
quota.c btrfs-progs: drop btrfs_init_path 2023-10-03 01:11:56 +02:00
seeding.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
tune.h btrfs-progs: tune: recover from failed btrfstune -m|M 2023-10-03 01:11:55 +02:00