From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 819CA43CEC2 for ; Tue, 10 Mar 2026 09:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773133903; cv=none; b=np/nF0ZUgPC99gAzH18ILAwBIMAJDWaQg7mxom70k10xOIVzwECeR0wienb4s7TyAOGYhNYGDLOKfGHQ9GUyDXfISGx43F6owRk80z4+CyDcjskKYY+a0HnE1i+AB5yJ6q087M1zN5u35VJPg1TNDyDZlRZzWbSfTYXylXtifx4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773133903; c=relaxed/simple; bh=niXizPhah5hIAj3UF6lrgVzIWXZCa1tgKKfZO/MSq/E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uk/L9yDTLj86jjxXg6vZJaLEgWqHEH0KoAyYhdi+rnpSwE4WleItW/AggIrInqBLqXNAoKh116xtN7hSGQME1SwfbINICNYRPLabZ+hyEbot+n5c8CcyVX0r4r6B3IoU0NokWwC4SxqGyg1cu2vkNW5NoVBWk3KbX9Hv9Twkl2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id AB17168C4E; Tue, 10 Mar 2026 10:11:38 +0100 (CET) Date: Tue, 10 Mar 2026 10:11:37 +0100 From: Christoph Hellwig To: Andrey Albershteyn Cc: linux-xfs@vger.kernel.org, fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org, hch@lst.de, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-btrfs@vger.kernel.org, djwong@kernel.org Subject: Re: [PATCH v4 17/25] xfs: use read ioend for fsverity data verification Message-ID: <20260310091136.GA18959@lst.de> References: <20260309192355.176980-1-aalbersh@kernel.org> <20260309192355.176980-18-aalbersh@kernel.org> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260309192355.176980-18-aalbersh@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Mar 09, 2026 at 08:23:32PM +0100, Andrey Albershteyn wrote: > - if (bio_op(&ioend->io_bio) == REQ_OP_READ) > + if (bio_op(&ioend->io_bio) == REQ_OP_READ) { > + if (xfs_fsverity_is_file_data(ip, ioend->io_offset)) > + fsverity_verify_bio(ioend->io_vi, > + &ioend->io_bio); > iomap_finish_ioends(ioend, > blk_status_to_errno(ioend->io_bio.bi_status)); If bi_status is non-zero, there is no point in doing the verification. > - else > + } else { > xfs_end_ioend_write(ioend); > + } Also now that the code is non-trivial I'd add a xfs_end_ioend_read mirroring xfs_end_ioend_write. > @@ -764,9 +774,12 @@ xfs_bio_submit_read( > struct iomap_read_folio_ctx *ctx) > { > struct bio *bio = ctx->read_ctx; > + struct iomap_ioend *ioend; > > /* defer read completions to the ioend workqueue */ > - iomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset, 0); > + ioend = iomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset, 0); Overly long line. > if (bdev_has_integrity_csum(xfs_inode_buftarg(ip)->bt_bdev)) > return &xfs_iomap_read_ops; > + if (xfs_fsverity_is_file_data(ip, position)) > + return &xfs_iomap_read_ops; use || here instead of two checks? > +{ > + const struct inode *inode = VFS_IC(ip); > + > + return fsverity_active(inode) && > + offset < xfs_fsverity_metadata_offset(ip); Just open code the XFS_IC instead of a single use local variable? 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 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7666F3C27D for ; Tue, 10 Mar 2026 09:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5ENVAfmWvzn1b70OMAgmhNVwamV4fXVKXsxtoofbr/o=; b=kAazelGRnuWzkzSQZ4r6VMIIB2 2CSRQqonO/EAwOo+M+UxhViu7PrtNywS6A8LJhq8eGq2mLu8U7jz6fm541O6bkIRQaneN+i0YLZ/F KDKvBxMHYczg2SdFre4ucyQZoKo5y6jsStavxPl6n1JtYRpgC+1ogHbziJdcCovnbQt4=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vzt8I-0003IX-HM; Tue, 10 Mar 2026 09:12:07 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vzt7z-0003H0-Et for linux-f2fs-devel@lists.sourceforge.net; Tue, 10 Mar 2026 09:11:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LE2RxnyN/jDRTJaRtTBPD/kfuAhDiKppFDljYTHjPJU=; b=bdK4l7EmvenH2Ep0HhkIBjS5Mq yZHOkdPhYMJelH7wvD13S1X6jPfbRG6mRiIDzLumzbh58IZuGFTfXZRx8qOIO6LrKgoSahcBbG/Ad g/0N+6yzLlLcrTkxOoQ7eu8CRkNsYifi3HoIyHj2xepvNEwPrbmgj0iDz9dr2rqx9qvI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LE2RxnyN/jDRTJaRtTBPD/kfuAhDiKppFDljYTHjPJU=; b=Dr3/iwxXrcgdjnct0+/2tBF79Z vSBA9e4KYG6qfpnLmHHmN2NzaOy6pAoUdy7pZGhskxr4MFxo6hueMGKcT9hBkq7E2kFD5wPVSpB/t mLO0aX66OpAbxeTEixzwwNUvCjmFUaXESYvhOsMiOIgwduDfMa2Nrdm70bqHiZp7J0nk=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vzt7z-0001c0-OA for linux-f2fs-devel@lists.sourceforge.net; Tue, 10 Mar 2026 09:11:48 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id AB17168C4E; Tue, 10 Mar 2026 10:11:38 +0100 (CET) Date: Tue, 10 Mar 2026 10:11:37 +0100 From: Christoph Hellwig To: Andrey Albershteyn Message-ID: <20260310091136.GA18959@lst.de> References: <20260309192355.176980-1-aalbersh@kernel.org> <20260309192355.176980-18-aalbersh@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260309192355.176980-18-aalbersh@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Headers-End: 1vzt7z-0001c0-OA Subject: Re: [f2fs-dev] [PATCH v4 17/25] xfs: use read ioend for fsverity data verification X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fsverity@lists.linux.dev, ebiggers@kernel.org, djwong@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, hch@lst.de, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Mar 09, 2026 at 08:23:32PM +0100, Andrey Albershteyn wrote: > - if (bio_op(&ioend->io_bio) == REQ_OP_READ) > + if (bio_op(&ioend->io_bio) == REQ_OP_READ) { > + if (xfs_fsverity_is_file_data(ip, ioend->io_offset)) > + fsverity_verify_bio(ioend->io_vi, > + &ioend->io_bio); > iomap_finish_ioends(ioend, > blk_status_to_errno(ioend->io_bio.bi_status)); If bi_status is non-zero, there is no point in doing the verification. > - else > + } else { > xfs_end_ioend_write(ioend); > + } Also now that the code is non-trivial I'd add a xfs_end_ioend_read mirroring xfs_end_ioend_write. > @@ -764,9 +774,12 @@ xfs_bio_submit_read( > struct iomap_read_folio_ctx *ctx) > { > struct bio *bio = ctx->read_ctx; > + struct iomap_ioend *ioend; > > /* defer read completions to the ioend workqueue */ > - iomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset, 0); > + ioend = iomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset, 0); Overly long line. > if (bdev_has_integrity_csum(xfs_inode_buftarg(ip)->bt_bdev)) > return &xfs_iomap_read_ops; > + if (xfs_fsverity_is_file_data(ip, position)) > + return &xfs_iomap_read_ops; use || here instead of two checks? > +{ > + const struct inode *inode = VFS_IC(ip); > + > + return fsverity_active(inode) && > + offset < xfs_fsverity_metadata_offset(ip); Just open code the XFS_IC instead of a single use local variable? _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel