btrfs-progs/tune
Qu Wenruo 7a0da24f52 btrfs-progs: tune: do not allow multiple incompatible features to be set
[PROBLEM]
Btrfstune allows multiple different options to be executed in one go,
some options are completely fine, like no-holes along with extref, but
with more and more options, we need more exclusive checks.

In fact a lot of new options are already not following the old
success/total checks.

[ENHANCEMENT]
There is really no need to allow multiple features to be set in one go.

So this patch introduces an array which groups all the compatible
options into following categories:

- Extent tree
  This includes converting to/from extent and block group tree.

- Space cache
  This includes converting to v2 space cache.

- Metadata UUID
  This includes changing metadata uuid.

- FSID change
  This includes the slower full fs fsid rewrites.

- Csum change
  This includes the csum rewrites.

- Seed devices
  This includes changing the device seed flag.

- Legacy options
  This includes no-holes/extref/skinny-metadata features, which are
  already default mkfs features.

Now we only allow options inside the same group to be specified.
E.g. "btrfstune -r -S 1" would fail as it includes both legacy and seed
groups.
Meanwhile "btrfstune -r -n" would still be allowed.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-09-01 13:58:46 +02:00
..
change-csum.c btrfs-progs: fix more typos found by codespell 2023-08-28 17:24:24 +02:00
change-metadata-uuid.c btrfs-progs: tune: fix return without flag reset commit 2023-08-28 17:24:58 +02:00
change-uuid.c btrfs-progs: track changing_fsid flag in fs_devices 2023-08-23 19:36:31 +02:00
convert-bgt.c btrfs-progs: fix -Wmissing-prototypes warnings 2023-05-26 18:02:31 +02:00
main.c btrfs-progs: tune: do not allow multiple incompatible features to be set 2023-09-01 13:58:46 +02:00
seeding.c btrfs-progs: fix -Wmissing-prototypes warnings 2023-05-26 18:02:31 +02:00
tune.h btrfs-progs: tune: rework the main idea of csum change 2023-05-26 18:02:32 +02:00