From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3579F3ED5AB; Mon, 9 Mar 2026 19:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773084281; cv=none; b=sgO7CviWGAcsHJSVaGjKdLPYvHo49TkxvIWLz4aDte4yBinKHYhWVQ51llIyLDhqXGFoO51W0kVjdRNdHIqg5wcawlxCeNmCT7y+PpEsddQNxCf5CQLqJaHxyUEJKEdy2E2oSSHWYPuhZFMtxi6/4ZNbVxtBbh5scbp0dqb7UJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773084281; c=relaxed/simple; bh=ogWSMF2PJnhgHUDXKpdHXZ+YvdNJgyOyWZkXlSnS970=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LJIhuVae/yJxOlaCMUughN897cMQwB3icoP/LzM1objLsEt/jaW+zO+w0zwkkfrcOJU3JJGvUWWe1uSrl9zO02udz3oZ7bquf8vbaY57llhUSO/0RkIulZQASIFa7WyEqKlKvLrRtWHj5h/Q7UM+1lp0rAmMYifycsRFZSLvgIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ro/9xW5U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ro/9xW5U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB56BC2BC9E; Mon, 9 Mar 2026 19:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773084280; bh=ogWSMF2PJnhgHUDXKpdHXZ+YvdNJgyOyWZkXlSnS970=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ro/9xW5UENPYp71Y2lpc/kQ08y7PL8D4G1tzfy21/0ccpYWmaZnYVPBqMq7KfHLBJ pRSr9EuVfurF3pvGeJ8mGC9MyLRqkQQ6ROEjmV8TOMR0a29J2/89ee5+zp20xqsWA5 0WAgNArwdLEAIW0tvN3FyOQK0kqZ7oibuYCpLQFIF7Vy+EOQk7CRn0Rqx6NbDpi72m R6NpMFqAdfYR+czawOhxqk9HcN4l7b1jm1dIvR1isbZ56bhU9PiWBv+otdUa5osfSK MdIhHMwDLMVH3zp4O9XeaSTUqlZ38ymMD5VjK1e27x4xuj3VsM+qXul7EzlworoWQi /XxGxz67wqRfw== From: Andrey Albershteyn To: linux-xfs@vger.kernel.org, fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org Cc: Andrey Albershteyn , hch@lst.de, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-btrfs@vger.kernel.org, djwong@kernel.org Subject: [PATCH v4 08/25] iomap: obtain fsverity info for read path Date: Mon, 9 Mar 2026 20:23:23 +0100 Message-ID: <20260309192355.176980-9-aalbersh@kernel.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260309192355.176980-1-aalbersh@kernel.org> References: <20260309192355.176980-1-aalbersh@kernel.org> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Obtain fsverity info for folios with file data. Filesystem can pass vi down to ioend and then to fsverity for verification. XFS will use it in further patch for fsverity integration. Signed-off-by: Andrey Albershteyn --- fs/iomap/buffered-io.c | 7 +++++++ include/linux/iomap.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 530794dcdd91..a335a18c307f 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "internal.h" #include "trace.h" @@ -590,6 +591,9 @@ void iomap_read_folio(const struct iomap_ops *ops, trace_iomap_readpage(iter.inode, 1); + if (iter.pos < i_size_read(iter.inode)) + ctx->vi = fsverity_get_info(iter.inode); + while ((ret = iomap_iter(&iter, ops)) > 0) iter.status = iomap_read_folio_iter(&iter, ctx, &bytes_submitted); @@ -656,6 +660,9 @@ void iomap_readahead(const struct iomap_ops *ops, trace_iomap_readahead(rac->mapping->host, readahead_count(rac)); + if (iter.pos < i_size_read(iter.inode)) + ctx->vi = fsverity_get_info(iter.inode); + while (iomap_iter(&iter, ops) > 0) iter.status = iomap_readahead_iter(&iter, ctx, &cur_bytes_submitted); diff --git a/include/linux/iomap.h b/include/linux/iomap.h index dc39837b0d45..89e5a7abc012 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -432,6 +432,7 @@ struct iomap_ioend { loff_t io_offset; /* offset in the file */ sector_t io_sector; /* start sector of ioend */ void *io_private; /* file system private data */ + struct fsverity_info *io_vi; /* fsverity info */ struct bio io_bio; /* MUST BE LAST! */ }; @@ -506,6 +507,7 @@ struct iomap_read_folio_ctx { struct readahead_control *rac; void *read_ctx; loff_t read_ctx_file_offset; + struct fsverity_info *vi; }; struct iomap_read_ops { -- 2.51.2 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 D8F4DFCA17B for ; Mon, 9 Mar 2026 19:24:54 +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: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-ID:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DAVUFRijhZC3ZxbfVe1pKzJGVdCevsqrDEhAOonRcHs=; b=Q9eg5zcmlI6/e/sVQqilEbWhMS xsTRyJFr9+kjuaUaiDKx/6RBDhTarrMLnEH+JIdIoU6h0UVavW8a/KXm+Mu9a66CFTwuag98jccXC kEVjedVcccZ1VAx4lB6PU94x7OTc9k+oJQAziwSo6APbdF14QXAY43mFyGaqiTduOA7A=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vzgDm-00088Q-Ij; Mon, 09 Mar 2026 19:24:54 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vzgDk-00088D-9L for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Mar 2026 19:24:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: 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=4XYDWrn27YbXmc7Iw1YwcEG0vJahSZAQg6TX0BunSmg=; b=bGyi5DQyHRAWLC5fnFSh7owRaL jazJetPvb7m1eb9pQkS0ZHsmxBH4ewSbq+pnD3wLfUfGt4X6PkiOPCeVp7gs0CNEGvak3qaCz7tDf zu15lBn5O5v/ddfRbJTNeGOy2Hrb7pO+/GZs14QQ4vtAxvA3Rosx6MGXJd4le/wmhBpU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=4XYDWrn27YbXmc7Iw1YwcEG0vJahSZAQg6TX0BunSmg=; b=UaTNFvI685NY4T4HlMrZGcCU16 sejnAzgtHD0O0dz3EMm0bW/WEuJ5+EheUz+hpZJYaAjHmA5r8uGQwTJXtXu8UfGEEbH08xBzyImGw 3Xf2nqRgWJScD13e9pV4ZEc0+X2VoYAiawu6YdkZ3jZ8MrT5cAgjA13gLpXo5SVnCBPY=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vzgDj-0001FX-Qo for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Mar 2026 19:24:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 3C1C2600C4; Mon, 9 Mar 2026 19:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB56BC2BC9E; Mon, 9 Mar 2026 19:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773084280; bh=ogWSMF2PJnhgHUDXKpdHXZ+YvdNJgyOyWZkXlSnS970=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ro/9xW5UENPYp71Y2lpc/kQ08y7PL8D4G1tzfy21/0ccpYWmaZnYVPBqMq7KfHLBJ pRSr9EuVfurF3pvGeJ8mGC9MyLRqkQQ6ROEjmV8TOMR0a29J2/89ee5+zp20xqsWA5 0WAgNArwdLEAIW0tvN3FyOQK0kqZ7oibuYCpLQFIF7Vy+EOQk7CRn0Rqx6NbDpi72m R6NpMFqAdfYR+czawOhxqk9HcN4l7b1jm1dIvR1isbZ56bhU9PiWBv+otdUa5osfSK MdIhHMwDLMVH3zp4O9XeaSTUqlZ38ymMD5VjK1e27x4xuj3VsM+qXul7EzlworoWQi /XxGxz67wqRfw== To: linux-xfs@vger.kernel.org, fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org Date: Mon, 9 Mar 2026 20:23:23 +0100 Message-ID: <20260309192355.176980-9-aalbersh@kernel.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260309192355.176980-1-aalbersh@kernel.org> References: <20260309192355.176980-1-aalbersh@kernel.org> MIME-Version: 1.0 X-Headers-End: 1vzgDj-0001FX-Qo Subject: [f2fs-dev] [PATCH v4 08/25] iomap: obtain fsverity info for read path 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: , From: Andrey Albershteyn via Linux-f2fs-devel Reply-To: Andrey Albershteyn Cc: Andrey Albershteyn , djwong@kernel.org, linux-f2fs-devel@lists.sourceforge.net, 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 Obtain fsverity info for folios with file data. Filesystem can pass vi down to ioend and then to fsverity for verification. XFS will use it in further patch for fsverity integration. Signed-off-by: Andrey Albershteyn --- fs/iomap/buffered-io.c | 7 +++++++ include/linux/iomap.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 530794dcdd91..a335a18c307f 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "internal.h" #include "trace.h" @@ -590,6 +591,9 @@ void iomap_read_folio(const struct iomap_ops *ops, trace_iomap_readpage(iter.inode, 1); + if (iter.pos < i_size_read(iter.inode)) + ctx->vi = fsverity_get_info(iter.inode); + while ((ret = iomap_iter(&iter, ops)) > 0) iter.status = iomap_read_folio_iter(&iter, ctx, &bytes_submitted); @@ -656,6 +660,9 @@ void iomap_readahead(const struct iomap_ops *ops, trace_iomap_readahead(rac->mapping->host, readahead_count(rac)); + if (iter.pos < i_size_read(iter.inode)) + ctx->vi = fsverity_get_info(iter.inode); + while (iomap_iter(&iter, ops) > 0) iter.status = iomap_readahead_iter(&iter, ctx, &cur_bytes_submitted); diff --git a/include/linux/iomap.h b/include/linux/iomap.h index dc39837b0d45..89e5a7abc012 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -432,6 +432,7 @@ struct iomap_ioend { loff_t io_offset; /* offset in the file */ sector_t io_sector; /* start sector of ioend */ void *io_private; /* file system private data */ + struct fsverity_info *io_vi; /* fsverity info */ struct bio io_bio; /* MUST BE LAST! */ }; @@ -506,6 +507,7 @@ struct iomap_read_folio_ctx { struct readahead_control *rac; void *read_ctx; loff_t read_ctx_file_offset; + struct fsverity_info *vi; }; struct iomap_read_ops { -- 2.51.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel