From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz, Qu Wenruo <quwenruo.btrfs@gmx.com>,
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 17:30:18 +0300 [thread overview]
Message-ID: <a12decb3-6f08-91f8-cc58-e5b18b9aa520@suse.com> (raw)
In-Reply-To: <20180605142406.GD3539@twin.jikos.cz>
On 5.06.2018 17:24, David Sterba wrote:
> 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.
WOuld it be possible to then take Qu's patch which deletes a lot of code
for 4.19?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2018-06-05 14:30 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
2018-06-05 14:30 ` Nikolay Borisov [this message]
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=a12decb3-6f08-91f8-cc58-e5b18b9aa520@suse.com \
--to=nborisov@suse.com \
--cc=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).