Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1052251rwl; Wed, 5 Apr 2023 11:04:33 -0700 (PDT) X-Google-Smtp-Source: AKy350aKn2k7gAJUGA5OELNruyxOm6H1oZUKtYNwvqqR6w4ayPGCklHolKt7k9gi4G+PLubFoLEQ X-Received: by 2002:aa7:8bd1:0:b0:626:2ce1:263c with SMTP id s17-20020aa78bd1000000b006262ce1263cmr6092930pfd.5.1680717873150; Wed, 05 Apr 2023 11:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680717873; cv=none; d=google.com; s=arc-20160816; b=XJfoc14D43Kiqw+AtlUgVm87huMQaeqBhQBBWnEEx7W/b5aBZ1ekEhPyk45Aof61fI 8olzs7S23GrNQQvR7ci70p81g6U9z1knhKjW/j9T2pbsp3O5I8VtqfIBBJVracCT4+Q9 QPkrK+m1lxuEL87Oib1zmpc3U5NAhp4T/L3tNMumD9Q5UrrGwrRydIfmYOhtKnm4aFbA U+uKvP6Bukt3zp8r4nCi4MZdf8gNODxvjrmdoZRawtkS33Nw58GDB41IWsMIyk3aeOW4 1YBmMe8ttmKONEKKB90/5B3/EH8x2iQq4GmQRWD//dvaxP5Y3Nif0kxZ2DOTnG0oHcvq oK9Q== 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=dmAZmojKfIM/z2MtFjBGD6EJ+69KjhZ8tshJmiwlSl0=; b=eBz439PYGhCgxpJrtGLpZVn018QBY+nl2QrhYVtZIPUPG3voWQJiXd0F2MyP1lmtCk PdlCMHkRRs2pJyLU7ZZ4Wwl9b8Zk4RQgMA53WfMOq4+PKpD5A1ARm19bTlVacDGX6KEx WnSORmKP62F1+23BiYidwnQZ3Co1CzdA7pjRAMp8ig8uxikTeFhN+uOUJ8Fed65eZVys Say5LaUSS2QDQjxwWYyy+CwU674Eb/S4tHDEfC6CP1h3ssYY66G3UJi7l/GgKy771AyS Qh67Z8g2uhU/MRoEt+ZiIvtb23tbAMPrOMY7YGGIyF3O8PoVqIqkBjCexEgre5qhJ2No LDeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bDpmWKsJ; 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 u69-20020a627948000000b0062ae6345c64si13130333pfc.383.2023.04.05.11.04.17; Wed, 05 Apr 2023 11:04:33 -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=bDpmWKsJ; 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 S229379AbjDESDt (ORCPT + 99 others); Wed, 5 Apr 2023 14:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjDESDr (ORCPT ); Wed, 5 Apr 2023 14:03:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773E96584; Wed, 5 Apr 2023 11:03:02 -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 74A8D62A89; Wed, 5 Apr 2023 18:02:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96EE1C433D2; Wed, 5 Apr 2023 18:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680717768; bh=3aMW3YLQCtQtlrkIbSPGZmnQ0yHQUxiJ9ttklW4hHxM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bDpmWKsJVZ3ckZA2xplbSRbcINv1TpMxisrITW5MrlmHOMQ3fien87NPN4a9AJA/B x/QThFLx1SwGIWFo7Yx4Ag15CHnoj5bQhPU74Lr9NnQzQAppm4KDtyjgnjuKzJLhfa 7HyOovstmSkofw3kQLFfw9x5/h+8yFRSKEbXd3TFBt1w7lWOvtRr56+nYgTgBGNR50 Ljh42NAKmGC04mDXzBLfWEnfodDd6BPXzXQouL4wP0Gh16p95effEXjNlRYp8rj8tc QM6XfbnPOu9Rc95DaJV9yZ5Z6e/fRetGpCm+o4wsNTx7fpv6ZZEpQM7h1h3nHBzDie nZaAvfwaMjd3A== Date: Wed, 5 Apr 2023 18:02:47 +0000 From: Eric Biggers To: Christoph Hellwig Cc: "Darrick J. Wong" , Andrey Albershteyn , 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 19/23] xfs: disable direct read path for fs-verity sealed files Message-ID: References: <20230404145319.2057051-1-aalbersh@redhat.com> <20230404145319.2057051-20-aalbersh@redhat.com> <20230404161047.GA109974@frogsfrogsfrogs> <20230405150142.3jmxzo5i27bbc4c4@aalbersh.remote.csb> <20230405150927.GD303486@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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:50:10AM -0700, Christoph Hellwig wrote: > On Wed, Apr 05, 2023 at 08:09:27AM -0700, Darrick J. Wong wrote: > > Thinking about this a little more -- I suppose we shouldn't just go > > breaking directio reads from a verity file if we can help it. Is there > > a way to ask fsverity to perform its validation against some arbitrary > > memory buffer that happens to be fs-block aligned? You could certainly add such a function that wraps around verify_data_block(). The minimal function prototype needed (without supporting readahead or reusing the ahash_request) would be something like the following, I think: bool fsverity_verify_blocks_dio(struct inode *inode, u64 pos, struct folio *folio, size_t len, size_t offset); And I really hope that you don't want to do DIO to the *Merkle tree*, as that would make the problem significantly harder. I think DIO for the data, but handling the Merkle tree in the usual way, would be okay? > > That would be my preference as well. But maybe Eric know a good reason > why this hasn't been done yet. > I believe it would be possible, especially if DIO to the Merkle tree is not in scope. There just hasn't been a reason to the work yet. And ext4 and f2fs already fall back to buffer I/O for other filesystem features, so there was precedent for not bothering with DIO, at least in the initial version. - Eric