[PATCH v6 2/8] btrfs: disable verity on encrypted inodes

Daniel Vacek posted 8 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH v6 2/8] btrfs: disable verity on encrypted inodes
Posted by Daniel Vacek 2 months, 4 weeks ago
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

Right now there isn't a way to encrypt things that aren't either
filenames in directories or data on blocks on disk with extent
encryption, so for now, disable verity usage with encryption on btrfs.

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Boris Burkov <boris@bur.io>
---
No changes since v5, just a merge conflict due to cleanup in context.
---
 fs/btrfs/verity.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c
index 16f5580cba55..06dfcb461f53 100644
--- a/fs/btrfs/verity.c
+++ b/fs/btrfs/verity.c
@@ -578,6 +578,9 @@ static int btrfs_begin_enable_verity(struct file *filp)
 
 	btrfs_assert_inode_locked(inode);
 
+	if (IS_ENCRYPTED(&inode->vfs_inode))
+		return -EOPNOTSUPP;
+
 	if (test_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags))
 		return -EBUSY;
 
-- 
2.51.0
Re: [PATCH v6 2/8] btrfs: disable verity on encrypted inodes
Posted by David Sterba 2 months, 4 weeks ago
On Wed, Nov 12, 2025 at 08:36:02PM +0100, Daniel Vacek wrote:
> From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> 
> Right now there isn't a way to encrypt things that aren't either
> filenames in directories or data on blocks on disk with extent
> encryption, so for now, disable verity usage with encryption on btrfs.

Maybe mention that fscrypt + fsverity is possible and could be
implemented in the future.