Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/4] btrfs: rescue= mount options enhancement to support interrupted csum conversion
Date: Fri, 14 Jun 2024 13:52:27 +0930	[thread overview]
Message-ID: <cover.1718338860.git.wqu@suse.com> (raw)

[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


             reply	other threads:[~2024-06-14  4:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  4:22 Qu Wenruo [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1718338860.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox