Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: introduce new "rescue=ignoremetacsums" mount option
Date: Fri, 14 Jun 2024 06:58:20 +0930	[thread overview]
Message-ID: <ffa354b9-4315-4e29-af2a-124a697d0eef@gmx.com> (raw)
In-Reply-To: <20240612193821.GK18508@twin.jikos.cz>



在 2024/6/13 05:08, David Sterba 写道:
> 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.

I'd prefer to change the NO_DATA_CSUMS one to use 'D' or 'd' (for data),
meanwhile for metadata we go 'M' or 'm'.

But on the other hand, I do not think data/meta csum ignoring really
deserves a dedicated state char.

It's not really that special compared to trans aborted or dummy fs.
(The same for dev-replacing)

I can add it for now, but I believe we need some better discussion on
the fs_state_chars.

>
> What I'm missing is the sysfs.c update, all options supported by rescue
> need to be listed in rescue_opts.
>
That would be updated in the next update.

Thanks,
Qu

  reply	other threads:[~2024-06-13 21:28 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
2024-06-13 21:28     ` Qu Wenruo [this message]
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=ffa354b9-4315-4e29-af2a-124a697d0eef@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=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