From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:51231 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbeFEOaV (ORCPT ); Tue, 5 Jun 2018 10:30:21 -0400 Subject: Re: [PATCH RFC ver.B] btrfs: scrub: Don't use inode pages for device replace To: dsterba@suse.cz, Qu Wenruo , Qu Wenruo , Qu Wenruo , linux-btrfs@vger.kernel.org References: <20180605043656.4006-1-wqu@suse.com> <20180605134237.GA3539@twin.jikos.cz> <20180605140721.GB3539@twin.jikos.cz> <144fe2e2-5506-6290-3f19-f1cdfba1490c@gmx.com> <20180605142406.GD3539@twin.jikos.cz> From: Nikolay Borisov Message-ID: Date: Tue, 5 Jun 2018 17:30:18 +0300 MIME-Version: 1.0 In-Reply-To: <20180605142406.GD3539@twin.jikos.cz> Content-Type: text/plain; charset=utf-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 >