From: Wang Yugui <wangyugui@e16-tech.com>
To: dsterba@suse.cz, Wang Yugui <wangyugui@e16-tech.com>,
linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@gmail.com>
Subject: Re: [PATCH v3] btrfs: fix a check-integrity warning on write caching disabled disk
Date: Thu, 04 Nov 2021 23:34:59 +0800 [thread overview]
Message-ID: <20211104233458.1670.409509F4@e16-tech.com> (raw)
In-Reply-To: <20211104150212.GZ20319@twin.jikos.cz>
Hi,
> On Wed, Nov 03, 2021 at 08:07:22AM +0800, Wang Yugui wrote:
> > Hi,
> >
> > > On Thu, Oct 28, 2021 at 06:32:54AM +0800, Wang Yugui wrote:
> > > > When a disk has write caching disabled, we skip submission of a bio
> > > > with flush and sync requests before writing the superblock, since
> > > > it's not needed. However when the integrity checker is enabled,
> > > > this results in reports that there are metadata blocks referred
> > > > by a superblock that were not properly flushed. So don't skip the
> > > > bio submission only when the integrity checker is enabled
> > > > for the sake of simplicity, since this is a debug tool and
> > > > not meant for use in non-debug builds.
> > > >
> > > > xfstest/btrfs/220 trigger a check-integrity warning like the following
> > > > when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y and the disk with WCE=0.
> > >
> > > Does this need the integrity checker to be also enabled by mount
> > > options? I don't think compile time (ie the #ifdef) is enough, the
> > > message is printed only when it's enabled based on check in
> > > __btrfsic_submit_bio "if (!btrfsic_is_initialized) return", where the
> > > rest of the function does all the verification.
> >
> > Yes. We need mount option 'check_int' or 'check_int_data' to trigger
> > this check-integrity warning.
>
> So the mount options need to be checked here as well.
We just need to add the mount option(check_int/check_int_data) to
changelog
when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y and the disk with WCE=0.
=>
when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y , and mount
option(check_int/check_int_data), and the disk with WCE=0.
The check of mount option(check_int/check_int_data) is done later
inside btrfsic_submit_bio. No necessary to check mount
option(check_int/check_int_data) here, we just need to match
submit_bio(linux/bio.h).
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
void btrfsic_submit_bio(struct bio *bio);
int btrfsic_submit_bio_wait(struct bio *bio);
#else
#define btrfsic_submit_bio submit_bio
#define btrfsic_submit_bio_wait submit_bio_wait
#endif
Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/11/04
next prev parent reply other threads:[~2021-11-04 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 22:32 [PATCH v3] btrfs: fix a check-integrity warning on write caching disabled disk Wang Yugui
2021-11-02 16:48 ` David Sterba
2021-11-03 0:07 ` Wang Yugui
2021-11-04 15:02 ` David Sterba
2021-11-04 15:34 ` Wang Yugui [this message]
2021-11-04 18:06 ` David Sterba
2021-11-04 19:24 ` David Sterba
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=20211104233458.1670.409509F4@e16-tech.com \
--to=wangyugui@e16-tech.com \
--cc=dsterba@suse.cz \
--cc=fdmanana@gmail.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