Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz
Cc: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: introduce new "rescue=ignoremetacsums" mount option
Date: Mon, 17 Jun 2024 06:54:18 +0930	[thread overview]
Message-ID: <d203bdcb-606f-4505-8250-f47646157404@gmx.com> (raw)
In-Reply-To: <20240616181724.GD25756@suse.cz>



在 2024/6/17 03:47, David Sterba 写道:
> On Fri, Jun 14, 2024 at 06:58:20AM +0930, Qu Wenruo wrote:
>>
>>
>> 在 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'.
>
> Changing would break backward compatibility, now it's part of user
> visible interface. It's not an ABI or API but at least we should do such
> changes without considering the consequences.
>
>> 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)
>
> The idea of the descriptors is to make it visible that the filesystem is
> in some unusual state, skipping checksum verification can make a
> difference when reading blocks that would normally not pass the check.

On the other hand, I have already changed the metadata csum mismatch output.
It should be enough to know if we're in a skipping-metadata-csum state.

Furthermore, all of these are in rescue mode with forced RO, which
should already be a thing to mention during report/debugging.

That's why I do not think skipping data/metadata csums really needs such
dedicated handling.

Thanks,
Qu

  reply	other threads:[~2024-06-16 21:24 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
2024-06-16 18:17       ` David Sterba
2024-06-16 21:24         ` Qu Wenruo [this message]
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=d203bdcb-606f-4505-8250-f47646157404@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