From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 1/4] btrfs: remove the dead branch in btrfs_io_needs_validation()
Date: Tue, 11 May 2021 13:27:27 +0200 [thread overview]
Message-ID: <20210511112727.GF7604@twin.jikos.cz> (raw)
In-Reply-To: <07444aed-81a3-4f1a-aaf4-e3462167383f@suse.com>
On Tue, May 11, 2021 at 07:56:42AM +0800, Qu Wenruo wrote:
> >> - if (bio_flagged(bio, BIO_CLONED)) {
> >> - if (btrfs_io_bio(bio)->iter.bi_size > blocksize)
> >> + bio_for_each_bvec_all(bvec, bio, i) {
> >> + len += bvec->bv_len;
> >> + if (len > blocksize)
> >> return true;
> >
> > I've looked if the bio cloning is used at all so we could potentially
> > get rid of all the BIO_CLONED assertions. There are still two cases:
> >
> > * btrfs_submit_direct calling btrfs_bio_clone_partial
>
> This is what I missed.
>
> In fact for DIO read repair we can still hit a cloned bio.
>
> But in that case, we still don't need any validation since the DIO read
> repair is ensured to only submit sector sized repair.
> So the patchset is still fine, but will break the bisect.
>
> > * btrfs_map_bio calling btrfs_bio_clone
>
> This is not a problem, as the generated bio are for real device, not for
> the inode pages, and read repair only happens for inode pages, we're
> completely fine.
>
> > So in this case I'd rather add an assertion before
> > bio_for_each_bvec_all, as this fits the usecase "this never happens".
> > The original assertions were added everywhere once the bio iteration
> > behaviour changed without much notice, so we need to be cautious.
> >
> > Applied with the following fixup
>
> Then bisect will be broken.
>
> If one is testing just this patch, DIO read repair will trigger the
> ASSERT().
>
> Is it possible to discard this patch and completely rely on the last
> patch to remove btrfs_io_needs_validation()?
Yeah, we want to keep it bisectable.
next prev parent reply other threads:[~2021-05-11 11:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 2:08 [PATCH v3 0/4] btrfs: make read time repair to be only submitted for each corrupted sector Qu Wenruo
2021-05-03 2:08 ` [PATCH v3 1/4] btrfs: remove the dead branch in btrfs_io_needs_validation() Qu Wenruo
2021-05-03 17:05 ` David Sterba
2021-05-03 23:39 ` Qu Wenruo
2021-05-10 20:14 ` David Sterba
2021-05-10 23:56 ` Qu Wenruo
2021-05-11 11:27 ` David Sterba [this message]
2021-05-03 2:08 ` [PATCH v3 2/4] btrfs: make btrfs_verify_data_csum() to return a bitmap Qu Wenruo
2021-05-03 2:08 ` [PATCH v3 3/4] btrfs: submit read time repair only for each corrupted sector Qu Wenruo
2021-05-10 20:32 ` David Sterba
2021-05-11 1:42 ` Qu Wenruo
2021-05-11 11:35 ` David Sterba
2021-05-03 2:08 ` [PATCH v3 4/4] btrfs: remove io_failure_record::in_validation Qu Wenruo
2021-05-10 20:41 ` [PATCH v3 0/4] btrfs: make read time repair to be only submitted for each corrupted sector David Sterba
2021-05-11 1:07 ` Qu Wenruo
2021-05-11 11:59 ` 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=20210511112727.GF7604@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