[PATCH v7 43/43] btrfs: disable send if we have encryption enabled
From: Daniel Vacek
Date: Wed May 13 2026 - 05:18:35 EST
From: Josef Bacik <josef@xxxxxxxxxxxxxx>
send needs to track the dir item values to see if files were renamed
when doing an incremental send. There is code to decrypt the names, but
this breaks the code that checks to see if something was overwritten.
Until this gap is closed we need to disable send on encrypted file
systems. Fixing this is straightforward, but a medium sized project.
Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
Reviewed-by: Boris Burkov <boris@xxxxxx>
Signed-off-by: Daniel Vacek <neelx@xxxxxxxx>
---
v5: https://lore.kernel.org/linux-btrfs/62ce86b38e2575c542eed7fbe8d986e68496b1d7.1706116485.git.josef@xxxxxxxxxxxxxx/
* No changes since.
---
fs/btrfs/send.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 1e80a3db1df2..11a3e928a4c2 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -8095,6 +8095,12 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
+ if (btrfs_fs_incompat(fs_info, ENCRYPT)) {
+ btrfs_err(fs_info,
+ "send with encryption enabled isn't currently suported");
+ return -EINVAL;
+ }
+
/*
* The subvolume must remain read-only during send, protect against
* making it RW. This also protects against deletion.
--
2.53.0