public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: add FS_IOC_READ_VERITY_METADATA ioctl
@ 2024-11-25  8:41 Allison Karlitskaya
  2024-11-25 18:11 ` Eric Biggers
  0 siblings, 1 reply; 7+ messages in thread
From: Allison Karlitskaya @ 2024-11-25  8:41 UTC (permalink / raw)
  To: Eric Biggers, Theodore Y . Ts'o
  Cc: linux-btrfs, fsverity, Allison Karlitskaya

e17fe6579de0 introduced FS_IOC_READ_VERITY_METADATA to directly query
the Merkle tree, descriptor and signature blocks for fs-verity enabled
files.  It also added the ioctl implementation to ext4 and f2fs, but
seems to have forgotten about btrfs.

Add the (trival) implementation for btrfs: we just need to wire it
through to the fs-verity code, the same way as was done for the other
two filesystems.  The fs-verity code already has access to the required
data.

FS_IOC_READ_VERITY_METADATA remains unimplemented for FUSE, but
implementing it there would be more involved.

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

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:
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-26 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25  8:41 [PATCH] btrfs: add FS_IOC_READ_VERITY_METADATA ioctl Allison Karlitskaya
2024-11-25 18:11 ` Eric Biggers
2024-11-25 20:06   ` Allison Karlitskaya
2024-11-26  2:33     ` Eric Biggers
2024-11-26 15:11       ` David Sterba
2024-11-26 15:23         ` Allison Karlitskaya
2024-11-26 16:23           ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox