From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: dsterba@suse.cz, Qu Wenruo <wqu@suse.de>,
Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace
Date: Tue, 5 Jun 2018 16:24:06 +0200 [thread overview]
Message-ID: <20180605142406.GD3539@twin.jikos.cz> (raw)
In-Reply-To: <144fe2e2-5506-6290-3f19-f1cdfba1490c@gmx.com>
On Tue, Jun 05, 2018 at 10:14:51PM +0800, Qu Wenruo wrote:
> >> The previous version (a completely different direction though) is much
> >> smaller.
> >> https://patchwork.kernel.org/patch/10440541/
> >>
> >> However personally speaking, I still prefer this one, as it's much simpler.
> >
> > As this will go to older stable kernels, I'd rather split that to more
> > patches where the first one is
> >
> > --- a/fs/btrfs/scrub.c
> > +++ b/fs/btrfs/scrub.c
> > @@ -2799,7 +2799,7 @@ static int scrub_extent(struct scrub_ctx *sctx, struct map_lookup *map,
> > have_csum = scrub_find_csum(sctx, logical, csum);
> > if (have_csum == 0)
> > ++sctx->stat.no_csum;
> > - if (sctx->is_dev_replace && !have_csum) {
> > + if (0 && sctx->is_dev_replace && !have_csum) {
> > ret = copy_nocow_pages(sctx, logical, l,
> > mirror_num,
> > physical_for_dev_replace);
> > ---
> >
> > and then the whole callchain of copy_nocow_pages continues.
>
> Understood.
> I could go this method.
>
> However I'm a little concerned about such "if (0 &&" usage.
>
> Although with gcc 8.1 it works without any warning, it still looks
> pretty strange, as compiler could one day detect such dead branch and
> find copy_nocow_pages() is never used.
I've checked that this does not produce any warnings, gcc 7.3.1. The
condition looks strange but does what we want. The whole series will be
in 4.18, the first patch in stable versions. If gcc does not warn today,
it will not in the future in any of the versions.
next prev parent reply other threads:[~2018-06-05 14:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 4:36 [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace Qu Wenruo
2018-06-05 5:34 ` Qu Wenruo
2018-06-05 13:42 ` David Sterba
2018-06-05 13:47 ` Qu Wenruo
2018-06-05 14:07 ` David Sterba
2018-06-05 14:14 ` Qu Wenruo
2018-06-05 14:24 ` David Sterba [this message]
2018-06-05 14:30 ` Nikolay Borisov
2018-06-06 12:07 ` David Sterba
2018-06-09 0:33 ` David Sterba
2018-06-09 7:09 ` Qu Wenruo
2018-06-07 1:01 ` james harvey
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=20180605142406.GD3539@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.com \
--cc=wqu@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).