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 4E50213AA2F; Mon, 26 Jan 2026 04:53:22 +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=1769403203; cv=none; b=L8Cks+8rhMz170tsNJXcjH34g7fMh703oCWtg4Soau7GRsnt51EKRW/DGhMxvpS9Dzp26qjqkKUi2uBR3rugKRqd1K80OBFbRT0Jqvtsv/wU+8Y87XCInlRxmuvsTbedMsd26vCiTZFIxKc2xHjpBuSLuI4BJrF7IsFsb7OJN8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769403203; c=relaxed/simple; bh=qk7tcUjY3jNpmvL2m/6gdI1xCGSkWczz93DDdOwjido=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QAnJXNGwhL8ZxwZx4BOQAPH12jX64CQs2aU+0mqOiCrssi3UwIMWlGS+mjdQJOcxIakBUu9vIcZZPzophzenwfKPUtIMHv7qyjSD9XBrzfyDTdKpd+ntnyvYxcz4FrKias4w727iQ/HRik6CF9OuUSShP3BI65Au0kvxN8jRZcQ= 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=36i8DIzC; 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="36i8DIzC" 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=Baqfeh51OjRK6HV70ZlkvyjNBgHNFVZMHUq9K/EvHmE=; b=36i8DIzCQLF8pmg3reAtEbJ9sG wcJTE1jDQYLnsLttdxp10J2byuHQUOP9gMi9jTq5zjQMBiG4KSxECj54nsmbtK9aE/+0Q9U01o+N5 D5kxWT9EYPA5Vmw50BOPmkcPJX3OhwSefv2ntcAZrc/bCSrWqCQ4+YkjmuyPUdWIDkRD1L1I69nB1 2E2Di2YB0DnVI5CTpC9cgYtn5WeGmJKSmY29k3CBUeykc+T+3Q/JvRAe4BTYAqqoi7PvHHEq+6Zcv PiQbjjJpKZbTb1p5kmfNOWeck1HbO9wqdqsBU61SJC2LfOUJhrJRLBwY9ULYZ0Ae1cMnm/qW9qcaG 68OVsN7A==; 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 1vkEbH-0000000BuT6-3zvi; Mon, 26 Jan 2026 04:53:20 +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 Subject: [PATCH 10/16] fsverity: deconstify the inode pointer in struct fsverity_info Date: Mon, 26 Jan 2026 05:50:56 +0100 Message-ID: <20260126045212.1381843-11-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260126045212.1381843-1-hch@lst.de> References: <20260126045212.1381843-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 --- fs/verity/fsverity_private.h | 4 ++-- fs/verity/open.c | 2 +- fs/verity/verify.c | 6 +++--- 3 files changed, 6 insertions(+), 6 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 881af159e705..55f1078c645a 100644 --- a/fs/verity/verify.c +++ b/fs/verity/verify.c @@ -156,10 +156,10 @@ static bool is_hash_block_verified(const struct fsverity_info *vi, * * Return: %true if the data block is valid, else %false. */ -static bool verify_data_block(struct inode *inode, - const struct fsverity_info *vi, +static bool verify_data_block(const 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; @@ -362,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