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 4C6823EFD04; Mon, 9 Mar 2026 19:24:25 +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=1773084265; cv=none; b=Ui0DhWlVkN7JG8XkpxxUqqWTZjSuRVFKNhvbmkmz3hCi+R406OXLTVq6acp5BXYsDOL5hBPLUXgK6mkVguz5xEAIy2AwV2urbqpJfpMumNlo5QIMkoyuv8vWuy1z1yGl1qqlQHL6kwcnBbBn8PA6A+RxwnfFOQLuFneHMWmORzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773084265; c=relaxed/simple; bh=pNHdBOW55LkBe0BiZ2NtLLPmFVSJ8bnWMqD9JSLDKkM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L5CIvIgwM1KgwToZWFoPJoqejquZA/neWc56Nyd+1y2Rn4+fwu+dVsIJpGGZ7WU9vKPfSHWCY8ENN6OWeMOBnIsYHbkmt1DKd1tUTV38qlvAy3/vY+mUpAs7xajQTMhJBZ5u+r+zSVYmL79+3Wd78RILIM+F1McSoatnSzkxaVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UuNgEYVq; 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="UuNgEYVq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FBD6C2BC87; Mon, 9 Mar 2026 19:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773084264; bh=pNHdBOW55LkBe0BiZ2NtLLPmFVSJ8bnWMqD9JSLDKkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuNgEYVqOlZ36E7jEOhV6/SvREYTBWbz6gHERQIb2g1KaKhV7ebKbsnmDPkcB/1+z s9Cdm/LkDjFiBnJ4mX344rYspK1mDkRNh+c38E1fq1bHeVX7U2LifQuXZRNSjQl2gs J4Z6K4wkbwncKNWL7drBI5/4pEOOD4zw8W/1vSOGnR/mbh/0OBbHFG9BVYao4sKH2S KoGZTlmIgJMLUSgfS/nOo61VttVeEvef5dCbnQ1YcAI0pmusXOILl4n+o9xBWCLfY+ STEg6E05rdNkX5/klf9stx8n+C43hl8JPVk6Qc5B4Q+F6Mi9kG0ZcmabFgyQR0+z00 c/npBcJYSDrVA== 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 02/25] fsverity: expose ensure_fsverity_info() Date: Mon, 9 Mar 2026 20:23:17 +0100 Message-ID: <20260309192355.176980-3-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 This function will be used by XFS's scrub to force fsverity activation, therefore, to read fsverity context. Signed-off-by: Andrey Albershteyn Reviewed-by: "Darrick J. Wong" --- fs/verity/open.c | 5 +++-- include/linux/fsverity.h | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/verity/open.c b/fs/verity/open.c index dfa0d1afe0fe..0483db672526 100644 --- a/fs/verity/open.c +++ b/fs/verity/open.c @@ -344,7 +344,7 @@ int fsverity_get_descriptor(struct inode *inode, return 0; } -static int ensure_verity_info(struct inode *inode) +int fsverity_ensure_verity_info(struct inode *inode) { struct fsverity_info *vi = fsverity_get_info(inode), *found; struct fsverity_descriptor *desc; @@ -380,12 +380,13 @@ static int ensure_verity_info(struct inode *inode) kfree(desc); return err; } +EXPORT_SYMBOL_GPL(fsverity_ensure_verity_info); int __fsverity_file_open(struct inode *inode, struct file *filp) { if (filp->f_mode & FMODE_WRITE) return -EPERM; - return ensure_verity_info(inode); + return fsverity_ensure_verity_info(inode); } EXPORT_SYMBOL_GPL(__fsverity_file_open); diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index a8f9aa75b792..8ba7806b225e 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -188,6 +188,7 @@ int fsverity_get_digest(struct inode *inode, /* open.c */ int __fsverity_file_open(struct inode *inode, struct file *filp); +int fsverity_ensure_verity_info(struct inode *inode); /* read_metadata.c */ @@ -281,6 +282,12 @@ static inline void fsverity_enqueue_verify_work(struct work_struct *work) WARN_ON_ONCE(1); } +static inline int fsverity_ensure_verity_info(struct inode *inode) +{ + WARN_ON_ONCE(1); + return -EOPNOTSUPP; +} + #endif /* !CONFIG_FS_VERITY */ static inline bool fsverity_verify_folio(struct fsverity_info *vi, -- 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 7C011FCA17B for ; Mon, 9 Mar 2026 19:24:37 +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=hfa7B7VpSUEvfuM8JYSubiDIhpssOSOWFNoLf8xFpk0=; b=NkPn5QOsPolY4U1Ho8pvQEfASB KIrDxCG13hglcP8AapWEyQ0sHVwjS8cLWOgSi+/5RGH6/vwjAv8wfNqiT2DvZUpkh7GgEwhkNK9F2 OQ64aTByBJ70o2uF+Ds9EspescIHYAtlHr3sF0lJ4s02UXxGU4OFFr/MDwXcWwCXJCQ8=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1vzgDV-0006Ss-5E; Mon, 09 Mar 2026 19:24:37 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1vzgDT-0006Si-Hy for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Mar 2026 19:24:35 +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=p0+hq9/DRDl/lw3PvjhaPOtKUxSn95L5cZAgltFzHQE=; b=CTNAlclIDU5Jr7P4LC3rQPagrT 6U9n11j9FFm8478veBX04Vqj4puba5qXqv4Tw2ymVutxWoDMqRRyBGqXfbZawvuoXDqlMeqBZMsBd pOhPCbaUtJr40mLCKniojMqOj3oOXoOFoJiOwEmYBJVu0IFZM+LJOxlWzxeY+Fecb93w=; 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=p0+hq9/DRDl/lw3PvjhaPOtKUxSn95L5cZAgltFzHQE=; b=l+zLmXc83apB/lKfSz+YBc9skz p7Ofr3w5v1bX1586Njuw9I47yG+YtbbQZOMi5liW+kbT++4iBOOCnww+IHgFDFCi8Mckvjzfwyh7s n2SjFHPRWaTWs4sqPx6ySlYvvdexXJR/NCfSgZ+UJ8vaswqQ1tdQ9Bv/2JxIlxm8tmxA=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vzgDT-0001Ek-6K for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Mar 2026 19:24:35 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id E1D5C44119; Mon, 9 Mar 2026 19:24:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FBD6C2BC87; Mon, 9 Mar 2026 19:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773084264; bh=pNHdBOW55LkBe0BiZ2NtLLPmFVSJ8bnWMqD9JSLDKkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuNgEYVqOlZ36E7jEOhV6/SvREYTBWbz6gHERQIb2g1KaKhV7ebKbsnmDPkcB/1+z s9Cdm/LkDjFiBnJ4mX344rYspK1mDkRNh+c38E1fq1bHeVX7U2LifQuXZRNSjQl2gs J4Z6K4wkbwncKNWL7drBI5/4pEOOD4zw8W/1vSOGnR/mbh/0OBbHFG9BVYao4sKH2S KoGZTlmIgJMLUSgfS/nOo61VttVeEvef5dCbnQ1YcAI0pmusXOILl4n+o9xBWCLfY+ STEg6E05rdNkX5/klf9stx8n+C43hl8JPVk6Qc5B4Q+F6Mi9kG0ZcmabFgyQR0+z00 c/npBcJYSDrVA== 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:17 +0100 Message-ID: <20260309192355.176980-3-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: 1vzgDT-0001Ek-6K Subject: [f2fs-dev] [PATCH v4 02/25] fsverity: expose ensure_fsverity_info() 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 This function will be used by XFS's scrub to force fsverity activation, therefore, to read fsverity context. Signed-off-by: Andrey Albershteyn Reviewed-by: "Darrick J. Wong" --- fs/verity/open.c | 5 +++-- include/linux/fsverity.h | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/verity/open.c b/fs/verity/open.c index dfa0d1afe0fe..0483db672526 100644 --- a/fs/verity/open.c +++ b/fs/verity/open.c @@ -344,7 +344,7 @@ int fsverity_get_descriptor(struct inode *inode, return 0; } -static int ensure_verity_info(struct inode *inode) +int fsverity_ensure_verity_info(struct inode *inode) { struct fsverity_info *vi = fsverity_get_info(inode), *found; struct fsverity_descriptor *desc; @@ -380,12 +380,13 @@ static int ensure_verity_info(struct inode *inode) kfree(desc); return err; } +EXPORT_SYMBOL_GPL(fsverity_ensure_verity_info); int __fsverity_file_open(struct inode *inode, struct file *filp) { if (filp->f_mode & FMODE_WRITE) return -EPERM; - return ensure_verity_info(inode); + return fsverity_ensure_verity_info(inode); } EXPORT_SYMBOL_GPL(__fsverity_file_open); diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index a8f9aa75b792..8ba7806b225e 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -188,6 +188,7 @@ int fsverity_get_digest(struct inode *inode, /* open.c */ int __fsverity_file_open(struct inode *inode, struct file *filp); +int fsverity_ensure_verity_info(struct inode *inode); /* read_metadata.c */ @@ -281,6 +282,12 @@ static inline void fsverity_enqueue_verify_work(struct work_struct *work) WARN_ON_ONCE(1); } +static inline int fsverity_ensure_verity_info(struct inode *inode) +{ + WARN_ON_ONCE(1); + return -EOPNOTSUPP; +} + #endif /* !CONFIG_FS_VERITY */ static inline bool fsverity_verify_folio(struct fsverity_info *vi, -- 2.51.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel