From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: introduce new "rescue=ignoremetacsums" mount option
Date: Wed, 12 Jun 2024 21:38:22 +0200 [thread overview]
Message-ID: <20240612193821.GK18508@twin.jikos.cz> (raw)
In-Reply-To: <f6b9b9037ee7912ed2081da9c4b05fd367c9e8f8.1718082585.git.wqu@suse.com>
On Tue, Jun 11, 2024 at 02:51:37PM +0930, Qu Wenruo wrote:
> This patch introduces "rescue=ignoremetacsums" to ignore metadata csums,
> meanwhile all the other metadata sanity checks are still kept as is.
>
> This new mount option is mostly to allow the kernel to mount an
> interrupted checksum conversion (at the metadata csum overwrite stage).
>
> And since the main part of metadata sanity checks is inside
> tree-checker, we shouldn't lose much safety, and the new mount option is
> rescue mount option it requires full read-only mount.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -367,6 +367,7 @@ int btrfs_validate_extent_buffer(struct extent_buffer *eb,
> u8 result[BTRFS_CSUM_SIZE];
> const u8 *header_csum;
> int ret = 0;
> + bool ignore_csum = btrfs_test_opt(fs_info, IGNOREMETACSUMS);
const
> --- a/fs/btrfs/messages.c
> +++ b/fs/btrfs/messages.c
> @@ -20,7 +20,7 @@ static const char fs_state_chars[] = {
> [BTRFS_FS_STATE_TRANS_ABORTED] = 'A',
> [BTRFS_FS_STATE_DEV_REPLACING] = 'R',
> [BTRFS_FS_STATE_DUMMY_FS_INFO] = 0,
> - [BTRFS_FS_STATE_NO_CSUMS] = 'C',
> + [BTRFS_FS_STATE_NO_DATA_CSUMS] = 'C',
There should be the status also when the metadata checksums are not
validated, the letters are arbitrary but should reflect the state if
possible, I'd suggest to use 'S' here.
What I'm missing is the sysfs.c update, all options supported by rescue
need to be listed in rescue_opts.
next prev parent reply other threads:[~2024-06-12 19:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 5:21 [PATCH 0/4] btrfs: rescue= mount options enhancement to support interrupted csum conversion Qu Wenruo
2024-06-11 5:21 ` [PATCH 1/4] btrfs: remove unused Opt enums Qu Wenruo
2024-06-12 19:31 ` David Sterba
2024-06-11 5:21 ` [PATCH 2/4] btrfs: output the unrecognized super flags as hex Qu Wenruo
2024-06-11 5:21 ` [PATCH 3/4] btrfs: introduce new "rescue=ignoremetacsums" mount option Qu Wenruo
2024-06-12 19:38 ` David Sterba [this message]
2024-06-13 21:28 ` Qu Wenruo
2024-06-16 18:17 ` David Sterba
2024-06-16 21:24 ` Qu Wenruo
2024-06-11 5:21 ` [PATCH 4/4] btrfs: introduce new "rescue=ignoresuperflags" " Qu Wenruo
2024-06-12 19:42 ` David Sterba
2024-06-13 21:46 ` Qu Wenruo
2024-06-11 16:43 ` [PATCH 0/4] btrfs: rescue= mount options enhancement to support interrupted csum conversion Josef Bacik
2024-06-13 21:23 ` Qu Wenruo
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=20240612193821.GK18508@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/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