Skip to content

btrfs-progs: tune: run "btrfs check" before and after full fs conversion

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs-progs: check: remove inode cache clearing functionalitycheck/main.c tests/misc-tests/060-ino-cache-clean/ino-cache-enabled.raw.xz tests/misc-tests/060-ino-cache-clean/test.sh+3 -111 reply
2/3btrfs-progs: check: export a dedicated btrfs_check() functioncheck/main.c common/utils.c common/utils.h+554 -4920 replies
3/3btrfs-progs: tune: add fsck runs before and after a full conversionMakefile tune/main.c+57 -15 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs-progs: tune: run "btrfs check" before and after full fs conversion

There are already two reports about some filesystem corruption after converting to block group tree.

So far we don't have any concrete evidence that block group tree conversion is the cause yet, but there are some possible cases like a unhealthy fs in the first place which can screw up such full fs conversion.

To rule out the possibility, let's run "btrfs check" both before and after a full fs conversion run (*), so that we make sure the fs is fine and stays fine during the conversion.

*: For now this includes the following operations:
- convert to block group tree
- convert to extent tree
- convert checksum type

For UUID change (not the metadata uuid one), although we're rewriting the whole fs, we are doing it in-place, thus not much can go wrong, unlike the above 3, which relies one full transactional protection. Other operations are just changing a super block flag.

The first patch is removing inode cache clearing from btrfs check, as we're exporting btrfs-check now, those deprecated functionality is no longer worthy maintaining in "btrfs check". (And it's still maintained, although only through "btrfs rescue").

The second patch would export the full "btrfs check" functionality through btrfs_check() function, with btrfs_check_options structure to toggle all the options.

Finally the last patch is doing all the extra checks for btrfstune.

Qu Wenruo (3):
btrfs-progs: check: remove inode cache clearing functionality
btrfs-progs: check: export a dedicated btrfs_check() function
btrfs-progs: tune: add fsck runs before and after a full conversion

 Makefile                                      |   3 +-
 check/main.c                                  | 999 +++++++++---------
 common/utils.c                                |  18 +
 common/utils.h                                |  41 +
 .../ino-cache-enabled.raw.xz                  | Bin
 .../060-ino-cache-clean}/test.sh              |   2 +-
 tune/main.c                                   |  55 +
 7 files changed, 614 insertions(+), 504 deletions(-)
 rename tests/{fsck-tests/046-ino-cache-clean => misc-tests/060-ino-cache-clean}/ino-cache-enabled.raw.xz (100%)
 rename tests/{fsck-tests/046-ino-cache-clean => misc-tests/060-ino-cache-clean}/test.sh (97%)

--
2.43.0