From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00449C388F7 for ; Tue, 10 Nov 2020 14:29:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3361206C0 for ; Tue, 10 Nov 2020 14:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730590AbgKJO3S (ORCPT ); Tue, 10 Nov 2020 09:29:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:41542 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbgKJO3S (ORCPT ); Tue, 10 Nov 2020 09:29:18 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3E2DEABD1; Tue, 10 Nov 2020 14:29:17 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id DDF5DDA7D7; Tue, 10 Nov 2020 15:27:35 +0100 (CET) Date: Tue, 10 Nov 2020 15:27:35 +0100 From: David Sterba To: Qu Wenruo Cc: dsterba@suse.cz, Qu Wenruo , linux-btrfs@vger.kernel.org Subject: Re: [PATCH 29/32] btrfs: scrub: introduce scrub_page::page_len for subpage support Message-ID: <20201110142735.GG6756@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Qu Wenruo , Qu Wenruo , linux-btrfs@vger.kernel.org References: <20201103133108.148112-1-wqu@suse.com> <20201103133108.148112-30-wqu@suse.com> <20201109182541.GB6756@twin.jikos.cz> <4164e848-bd32-644b-feb5-0bb29ab84353@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4164e848-bd32-644b-feb5-0bb29ab84353@gmx.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, Nov 10, 2020 at 08:56:21AM +0800, Qu Wenruo wrote: > > > On 2020/11/10 上午2:25, David Sterba wrote: > > On Tue, Nov 03, 2020 at 09:31:05PM +0800, Qu Wenruo wrote: > >> Currently scrub_page only has one csum for each page, this is fine if > >> page size == sector size, then each page has one csum for it. > >> > >> But for subpage support, we could have cases where only part of the page > >> is utilized. E.g one 4K sector is read into a 64K page. > >> In that case, we need a way to determine which range is really utilized. > >> > >> This patch will introduce scrub_page::page_len so that we can know > >> where the utilized range ends. > > > > Actually, this should be sectorsize or nodesize? Ie. is it necessary to > > track the length inside scrub_page at all? It might make sense for > > convenience though. > > > In the end, no need to track page_len for current implement. > It's always sector size. > > But that conflicts with the name "scrub_page", making it more > "scrub_sector". Yeah, that's would have to be updated as well and actually 'sector' is what we want to use. > Anyway, I need to update the scrub support patchset to follow the one > sector one scrub_page policy. I've added to misc-next, the other patches depend on the ->page_len patch. btrfs: scrub: refactor scrub_find_csum() btrfs: scrub: remove the force parameter of scrub_pages btrfs: scrub: distinguish scrub page from regular page