Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/4] btrfs: rescue= mount options enhancement to support interrupted csum conversion
@ 2024-06-14  4:22 Qu Wenruo
  2024-06-14  4:22 ` [PATCH v2 1/4] btrfs: remove unused Opt enums Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Qu Wenruo @ 2024-06-14  4:22 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v2:
- Add the new rescue options to supported rescue options sysfs interface
- Add the state char 'S' for skipping metadata csum
- Add an info line of unsupported super flags if rescue=ignoresuperflags
  is specified
- Add const prefix for one-time btrfs_test_opt() result

[REPO]
https://github.com/adam900710/linux/tree/rescue_changes

[BACKGROUND]
There is an adventurous user using btrfstune to convert a 32T btrfs
from crc32c to xxhash.

However for such huge fs, it takes too long time and the reporter
canceled the conversion.

This makes the reporter unable to mount the fs at all.

[CAUSE]
First of all, for a half converted fs, we will never allow RW mount, so
everything must be done in rescue mode.

There are several different stages of csum conversion, and at different
stage it requires different handling from kernel:

- Generationg new data csums
  At this stage only the super flags (CHANGING_DATA_CSUM flag) is
  preventing the kernel from mounting.

  Intrdoce "rescue=ignoresuperflags" to address this.

- Deleting old data cums
  The same super flags problem, with possible missing data csums.

  Despite the new "rescue=ignoresuperflags", end users will also need
  the existing "rescue=ignoredatacsums" mount option.

- Renaming the objectid of new data cums
  The new csums' objectid will be changed to the regular one.

  During this we can hit data csum mismatch.
  So the same "rescue=ignoresuperflags:ignoredatacsums" can handle it
  already.

- Rewriting metadata csums
  This part is done in-place (no COW), with a new super flags
  (CHANGING_META_CSUM).

  So here introduce a new "rescue=ignoremetacsums" to ignore the
  metadata checksum verification (and rely on the remaining sanity
  checks like tree-checkers).

The first 2 patches are just small cleanups, meanwhile the last two are
the new "rescue=" mount options to handle interrupted csum change.

Qu Wenruo (4):
  btrfs: remove unused Opt enums
  btrfs: output the unrecognized super flags as hex
  btrfs: introduce new "rescue=ignoremetacsums" mount option
  btrfs: introduce new "rescue=ignoresuperflags" mount option

 fs/btrfs/bio.c       |  2 +-
 fs/btrfs/disk-io.c   | 35 +++++++++++++++++++++++++----------
 fs/btrfs/file-item.c |  2 +-
 fs/btrfs/fs.h        |  5 ++++-
 fs/btrfs/messages.c  |  3 ++-
 fs/btrfs/super.c     | 27 +++++++++++++++++++++++----
 fs/btrfs/sysfs.c     |  2 ++
 fs/btrfs/zoned.c     |  2 +-
 8 files changed, 59 insertions(+), 19 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-10  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-14  4:22 [PATCH v2 0/4] btrfs: rescue= mount options enhancement to support interrupted csum conversion Qu Wenruo
2024-06-14  4:22 ` [PATCH v2 1/4] btrfs: remove unused Opt enums Qu Wenruo
2024-06-14  4:22 ` [PATCH v2 2/4] btrfs: output the unrecognized super flags as hex Qu Wenruo
2024-06-14  4:22 ` [PATCH v2 3/4] btrfs: introduce new "rescue=ignoremetacsums" mount option Qu Wenruo
2024-06-14  4:22 ` [PATCH v2 4/4] btrfs: introduce new "rescue=ignoresuperflags" " Qu Wenruo
2024-07-10  8:21   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox