Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2A0A936CE0E; Wed, 28 Jan 2026 15:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769614067; cv=none; b=l1cN86SpBBtg4ycRj5D5qrkbic4wLqCdxtqjgYADec6Bds0hpQNgv06jM1xvflkdU//zEdoMUIBr4uTsTUEH2m5IzBwB7JQZcklPXCW5knzwWQ8A8hmlhYzlB/RrKJDs6sVwNboTTK//DeTQoutqLwDoniT6Q+8LqZNWLVcvWGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769614067; c=relaxed/simple; bh=3Fy8vVgv271rtxAlamAzzrK1eXdIPdaHZvNQhnuH/QU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tAkbwQgRV0dy3ZrZ7luJbPB3BhdjJBJ49mYkMj8D6NsZjIJYnDPMEA4QV1jKO1X3KcMQ/gMZBiRme4CO82/VR9mtQyDbCJGiPhvmoj2/Yi7zzY4dsuHjAh24Wzxp1VcKvZJMu4I75n3aXXlFpyfdzASL0kAfjcGlnEhMi7uwQ7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ohvIUV+z; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ohvIUV+z" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=Mi7LhP6rFZ9ESa+DjhSAiE6zpd9hkvFYWYqDhPd4YeY=; b=ohvIUV+zi4yS4G8Shz0QHkDf67 uCqc/Ji0Hbcv5PZ7/peP1i0gU72BR8MPT1Cm2kszHmvS9FF6FFUP3UVvk4kistxDr6y7nFF3Z3nNo BSeJ2MCdi6Hh8Pd+s/xvBGzvMFg8/5Sp4rFsFoLyIV/Bqo+tXIWPAFKzwhBVQvUAtWgfYHOWosBu4 BCUd+Y4OBBHLBzfgSALW8C3RwyGiFpxIpPbQDFbIgX8DowxhG8h+Blcw+y7EcDaP1EufC4mscmJ0d SRsUj0iA+fy3HmMoeU1/7Fi3Qma2QsqwpN66IuM8E+VWXzPi7h2kwnXwiRMwpJCcXvtXUy0ca8tYs eWzzCgiQ==; Received: from 2a02-8389-2341-5b80-d601-7564-c2e0-491c.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d601:7564:c2e0:491c] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vl7SK-0000000GHWU-0Pd3; Wed, 28 Jan 2026 15:27:44 +0000 From: Christoph Hellwig To: Eric Biggers Cc: Al Viro , Christian Brauner , Jan Kara , David Sterba , "Theodore Ts'o" , Jaegeuk Kim , Chao Yu , Andrey Albershteyn , Matthew Wilcox , linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, fsverity@lists.linux.dev, "Darrick J. Wong" Subject: [PATCH 09/15] fsverity: deconstify the inode pointer in struct fsverity_info Date: Wed, 28 Jan 2026 16:26:21 +0100 Message-ID: <20260128152630.627409-10-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260128152630.627409-1-hch@lst.de> References: <20260128152630.627409-1-hch@lst.de> Precedence: bulk X-Mailing-List: fsverity@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html A lot of file system code expects a non-const inode pointer. Dropping the const qualifier here allows using the inode pointer in verify_data_block and prepares for further argument reductions. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" --- fs/verity/fsverity_private.h | 4 ++-- fs/verity/open.c | 2 +- fs/verity/verify.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h index dd20b138d452..f9f3936b0a89 100644 --- a/fs/verity/fsverity_private.h +++ b/fs/verity/fsverity_private.h @@ -73,7 +73,7 @@ struct fsverity_info { struct merkle_tree_params tree_params; u8 root_hash[FS_VERITY_MAX_DIGEST_SIZE]; u8 file_digest[FS_VERITY_MAX_DIGEST_SIZE]; - const struct inode *inode; + struct inode *inode; unsigned long *hash_block_verified; }; @@ -124,7 +124,7 @@ int fsverity_init_merkle_tree_params(struct merkle_tree_params *params, unsigned int log_blocksize, const u8 *salt, size_t salt_size); -struct fsverity_info *fsverity_create_info(const struct inode *inode, +struct fsverity_info *fsverity_create_info(struct inode *inode, struct fsverity_descriptor *desc); void fsverity_set_info(struct inode *inode, struct fsverity_info *vi); diff --git a/fs/verity/open.c b/fs/verity/open.c index 090cb77326ee..128502cf0a23 100644 --- a/fs/verity/open.c +++ b/fs/verity/open.c @@ -175,7 +175,7 @@ static void compute_file_digest(const struct fsverity_hash_alg *hash_alg, * appended builtin signature), and check the signature if present. The * fsverity_descriptor must have already undergone basic validation. */ -struct fsverity_info *fsverity_create_info(const struct inode *inode, +struct fsverity_info *fsverity_create_info(struct inode *inode, struct fsverity_descriptor *desc) { struct fsverity_info *vi; diff --git a/fs/verity/verify.c b/fs/verity/verify.c index f5bea750b427..6248d25a1f89 100644 --- a/fs/verity/verify.c +++ b/fs/verity/verify.c @@ -156,9 +156,10 @@ static bool is_hash_block_verified(struct fsverity_info *vi, struct page *hpage, * * Return: %true if the data block is valid, else %false. */ -static bool verify_data_block(struct inode *inode, struct fsverity_info *vi, +static bool verify_data_block(struct fsverity_info *vi, const struct fsverity_pending_block *dblock) { + struct inode *inode = vi->inode; const u64 data_pos = dblock->pos; const struct merkle_tree_params *params = &vi->tree_params; const unsigned int hsize = params->digest_size; @@ -361,7 +362,7 @@ fsverity_verify_pending_blocks(struct fsverity_verification_context *ctx) } for (i = 0; i < ctx->num_pending; i++) { - if (!verify_data_block(ctx->inode, vi, &ctx->pending_blocks[i])) + if (!verify_data_block(vi, &ctx->pending_blocks[i])) return false; } fsverity_clear_pending_blocks(ctx); -- 2.47.3