diff options
| author | Andrey Albershteyn <aalbersh@kernel.org> | 2026-10-03 00:36:44 +0200 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-10-04 19:30:51 +0200 |
| commit | ad7be74b38d83a31cd76c9cdc1bcc4cddbf03bd6 (patch) | |
| tree | b93f7abe72a0ad3cbc1f1d743c165b4e6b0e342e /include | |
| parent | 7a59a56fe4f3eda430c5aeda3c4bb4913da2395c (diff) | |
| download | linux-next-ad7be74b38d83a31cd76c9cdc1bcc4cddbf03bd6.tar.gz linux-next-ad7be74b38d83a31cd76c9cdc1bcc4cddbf03bd6.zip | |
fsverity: pass digest size and hash of the all-zeroes block to ->write
Let filesystem iterate over hashes in the block and check if these are
hashes of zeroed data blocks. XFS will use this to decide if it want to
store tree block full of these hashes.
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Acked-by: Eric Biggers <ebiggers@kernel.org>
Acked-by: David Sterba <dsterba@suse.com>
Link: https://patch.msgid.link/20261002223705.2175542-4-aalbersh@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fsverity.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index 3c3250f6f272..9e7d946676b9 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -124,6 +124,8 @@ struct fsverity_operations { * @buf: the Merkle tree block to write * @pos: the position of the block in the Merkle tree (in bytes) * @size: the Merkle tree block size (in bytes) + * @zero_digest: the hash of the all-zeroes block + * @digest_size: size of zero_digest, in bytes * * This is only called between ->begin_enable_verity() and * ->end_enable_verity(). @@ -131,7 +133,9 @@ struct fsverity_operations { * Return: 0 on success, -errno on failure */ int (*write_merkle_tree_block)(struct file *file, const void *buf, - u64 pos, unsigned int size); + u64 pos, unsigned int size, + const u8 *zero_digest, + unsigned int digest_size); }; #ifdef CONFIG_FS_VERITY |
