diff mbox series

btrfs: add FS_IOC_READ_VERITY_METADATA ioctl

Message ID 20241126152331.90434-1-allison.karlitskaya@redhat.com (mailing list archive)
State Handled Elsewhere
Headers show
Series btrfs: add FS_IOC_READ_VERITY_METADATA ioctl | expand

Commit Message

Allison Karlitskaya Nov. 26, 2024, 3:23 p.m. UTC
146054090b085 introduced fs-verity support for btrfs, but didn't add
support for FS_IOC_READ_VERITY_METADATA to directly query the Merkle
tree, descriptor and signature blocks for fs-verity enabled files.

Add the (trival) implementation: we just need to wire it through to the
fs-verity code, the same way as is done in the other two filesystems
which support this ioctl (ext4, f2fs). The fs-verity code already has
access to the required data.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
---
 fs/btrfs/ioctl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Sterba Nov. 26, 2024, 4:23 p.m. UTC | #1
On Tue, Nov 26, 2024 at 04:23:31PM +0100, Allison Karlitskaya wrote:
> 146054090b085 introduced fs-verity support for btrfs, but didn't add

Please use full reference of commits with the subject lines, like
146054090b08 ("btrfs: initial fsverity support")

The git alias command for that is below, you can name it like you want:

	show -s --pretty='format:%h (\"%s\")'

> support for FS_IOC_READ_VERITY_METADATA to directly query the Merkle
> tree, descriptor and signature blocks for fs-verity enabled files.
> 
> Add the (trival) implementation: we just need to wire it through to the
> fs-verity code, the same way as is done in the other two filesystems
> which support this ioctl (ext4, f2fs). The fs-verity code already has
> access to the required data.
> 
> Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>

Added to for-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index c9302d193187..392322a70ce8 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5290,6 +5290,8 @@  long btrfs_ioctl(struct file *file, unsigned int
 		return fsverity_ioctl_enable(file, (const void __user *)argp);
 	case FS_IOC_MEASURE_VERITY:
 		return fsverity_ioctl_measure(file, argp);
+	case FS_IOC_READ_VERITY_METADATA:
+		return fsverity_ioctl_read_metadata(file, argp);
 	case BTRFS_IOC_ENCODED_READ:
 		return btrfs_ioctl_encoded_read(file, argp, false);
 	case BTRFS_IOC_ENCODED_WRITE: