Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1034261rwl; Wed, 5 Apr 2023 10:52:57 -0700 (PDT) X-Google-Smtp-Source: AKy350YtLN5fsO/EtNgG1RDpuaEZVqbhgPRGwUy1MwI74jRvw16v8q+NL/Sa6v5X+kw/WvsBxmP4 X-Received: by 2002:a17:902:f105:b0:1a2:1042:cac1 with SMTP id e5-20020a170902f10500b001a21042cac1mr5684685plb.49.1680717177425; Wed, 05 Apr 2023 10:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680717177; cv=none; d=google.com; s=arc-20160816; b=YSNgPlqlYhUF4oobsTcYjfir7uOWgMI0Pk4e0BS47B17LXIQes7jOvtfWF49FvIbTB KKKXDicLBXsFod7iNDSCQX7Xvmaz+Bygj84ORw0/MCNfqPZM6vk5MQAPqpigLp19Vk3Z FFA2U6Lr3nTbSIm9ryv2pauN7VWe5Bl4aCL8GLCchJNSuS1JIcAOolNhLR0KUtUw3zjn wngt2FN5au2SI2mezHJfW68qJleaHWt9XF1TJca71JqU1riFAyudxI5bvZI1qgt6q5ux mxHTUEPYjfIYQ+q/kpC3pvY2ay5CnWD4q4CdmmChmbb5s8Ukbdm579MuFf6874f7leC5 Xodw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MRgvihe+1WyDTvsHn4M9QlfVv6sYj8QTdUgqotsbYXo=; b=ljZSIS2OQG4wDCWegzS7mrLqlzPAe6v1FXY1YKbtZpScMMSlqYkzwOvfcQEr8HIzdr QHz3gbSJsHVlazivY4w5E4goxxyRGZPRMbZs31CLo5/ATBFS9jRRYuoteYYFN7+f7KR9 YZSKaDOQU1FkwehQHlmQ0Pp6ugU5+f+vQtxruxdXCnPlrIMIJsryoMxNvWMwGcHe7IT5 dSSEVtfmtSsOnImDj/+infyN6TvLPQ7sAR6JaffJh1QS9YRjov2Pyzf8jXQp0AJqO4nA jPGrO3j3C5QSSDMjod/a4PBLc1mb6g7pO2RvM/ahyVZSrm3tjiADF0eE0zBufhSRvHKk rtAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N5ckeWaO; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a632a06000000b00514156db940si4374950pgq.171.2023.04.05.10.52.39; Wed, 05 Apr 2023 10:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N5ckeWaO; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229446AbjDERuv (ORCPT + 99 others); Wed, 5 Apr 2023 13:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjDERuu (ORCPT ); Wed, 5 Apr 2023 13:50:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFBBE4EFF; Wed, 5 Apr 2023 10:50:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4E57063EFD; Wed, 5 Apr 2023 17:50:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66EE0C433D2; Wed, 5 Apr 2023 17:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680717048; bh=8RyRFaPwlCx6/LOIIjBet5SjJyIkLiaizKSwCarmDik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N5ckeWaOWk8DYRS/vHEJFODUdFDterIWk0v6dwVPSI9Eqo5M3E9e4grJyjnLkrviz dmFQfemBW4Yipr4UCkQqWu/G0jjSFPpIfLv1Je78AwwHLIERp0PH1/vRe80YL6RRYZ JHue6126dFHFUdI0jGeczDDfabiD0M1vLyQEPVfbHZX3zYTjLfOHFds9uxGxs3TRQA 4MnoQS7XV3DutZNo5CjWayJ9Vw8uMHLtIdvQkc3cGo0pogH7TUG6lTRLj5yrPGYu4M tKZPz4nQeJIMNPgpgrINAMfcVgJNK3JNCa+gggxvfOkDxw9yi9kDdMaMWz6bTaOSji hhrgnfYs6HsxA== Date: Wed, 5 Apr 2023 17:50:46 +0000 From: Eric Biggers To: Christoph Hellwig Cc: Andrey Albershteyn , djwong@kernel.org, dchinner@redhat.com, linux-xfs@vger.kernel.org, fsverity@lists.linux.dev, rpeterso@redhat.com, agruenba@redhat.com, xiang@kernel.org, chao@kernel.org, damien.lemoal@opensource.wdc.com, jth@kernel.org, linux-erofs@lists.ozlabs.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com Subject: Re: [PATCH v2 05/23] fsverity: make fsverity_verify_folio() accept folio's offset and size Message-ID: References: <20230404145319.2057051-1-aalbersh@redhat.com> <20230404145319.2057051-6-aalbersh@redhat.com> <20230405103642.ykmgjgb7yi7htphf@aalbersh.remote.csb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 05, 2023 at 08:46:45AM -0700, Christoph Hellwig wrote: > On Wed, Apr 05, 2023 at 12:36:42PM +0200, Andrey Albershteyn wrote: > > Hi Christoph, > > > > On Tue, Apr 04, 2023 at 08:30:36AM -0700, Christoph Hellwig wrote: > > > On Tue, Apr 04, 2023 at 04:53:01PM +0200, Andrey Albershteyn wrote: > > > > Not the whole folio always need to be verified by fs-verity (e.g. > > > > with 1k blocks). Use passed folio's offset and size. > > > > > > Why can't those callers just call fsverity_verify_blocks directly? > > > > > > > They can. Calling _verify_folio with explicit offset; size appeared > > more clear to me. But I'm ok with dropping this patch to have full > > folio verify function. > > Well, there is no point in a wrapper if it has the exact same signature > and functionality as the functionality being wrapped. > > That being said, right now fsverity_verify_folio, so it might make sense > to either rename it, or rename fsverity_verify_blocks to > fsverity_verify_folio. But that's really a question for Eric. I thought it would be confusing for fsverity_verify_folio() to not actually verify a whole folio. So, for now we have: fsverity_verify_page: verify a whole page fsverity_verify_folio: verify a whole folio fsverity_verify_blocks: verify a range of blocks in a folio IMO that makes sense. Note: fsverity_verify_folio() is currently unused, but ext4 might use it. So, just use fsverity_verify_blocks(). - Eric