* [PATCH v3 1/7] btrfs-progs: add new FEATURE_INCOMPAT_ENCRYPT flag
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 2/7] btrfs-progs: start tracking extent encryption context info Daniel Vacek
` (7 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Matches kernel change by the same name.
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
kernel-shared/ctree.h | 1 +
kernel-shared/uapi/btrfs.h | 1 +
libbtrfsutil/btrfs.h | 1 +
3 files changed, 3 insertions(+)
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index cb5a5f3f..177163f8 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -99,6 +99,7 @@ static inline u32 __BTRFS_LEAF_DATA_SIZE(u32 nodesize)
BTRFS_FEATURE_INCOMPAT_ZONED | \
BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 | \
BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE | \
+ BTRFS_FEATURE_INCOMPAT_ENCRYPT | \
BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA | \
BTRFS_FEATURE_INCOMPAT_REMAP_TREE)
#else
diff --git a/kernel-shared/uapi/btrfs.h b/kernel-shared/uapi/btrfs.h
index a765fbc4..7144f3ba 100644
--- a/kernel-shared/uapi/btrfs.h
+++ b/kernel-shared/uapi/btrfs.h
@@ -359,6 +359,7 @@ _static_assert(sizeof(struct btrfs_ioctl_fs_info_args) == 1024);
#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
#define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
+#define BTRFS_FEATURE_INCOMPAT_ENCRYPT (1ULL << 15)
#define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
#define BTRFS_FEATURE_INCOMPAT_REMAP_TREE (1ULL << 17)
diff --git a/libbtrfsutil/btrfs.h b/libbtrfsutil/btrfs.h
index 47d9ebf8..eac42473 100644
--- a/libbtrfsutil/btrfs.h
+++ b/libbtrfsutil/btrfs.h
@@ -328,6 +328,7 @@ struct btrfs_ioctl_fs_info_args {
#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
#define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
+#define BTRFS_FEATURE_INCOMPAT_ENCRYPT (1ULL << 15)
#define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
struct btrfs_ioctl_feature_flags {
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v3 2/7] btrfs-progs: start tracking extent encryption context info
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 1/7] btrfs-progs: add new FEATURE_INCOMPAT_ENCRYPT flag Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 3/7] btrfs-progs: add inode encryption contexts Daniel Vacek
` (6 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
This recapitulates the kernel change named 'btrfs: start tracking extent
encryption context info".
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
kernel-shared/tree-checker.c | 17 ++++++++++-------
kernel-shared/uapi/btrfs_tree.h | 6 ++++++
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/kernel-shared/tree-checker.c b/kernel-shared/tree-checker.c
index 5e716422..cd3d5d27 100644
--- a/kernel-shared/tree-checker.c
+++ b/kernel-shared/tree-checker.c
@@ -239,6 +239,8 @@ static int check_extent_data_item(struct extent_buffer *leaf,
u32 sectorsize = fs_info->sectorsize;
u32 item_size = btrfs_item_size(leaf, slot);
u64 extent_end;
+ u8 policy;
+ u8 fe_type;
if (unlikely(!IS_ALIGNED(key->offset, sectorsize))) {
file_extent_err(leaf, slot,
@@ -269,12 +271,12 @@ static int check_extent_data_item(struct extent_buffer *leaf,
SZ_4K);
return -EUCLEAN;
}
- if (unlikely(btrfs_file_extent_type(leaf, fi) >=
- BTRFS_NR_FILE_EXTENT_TYPES)) {
+
+ fe_type = btrfs_file_extent_type(leaf, fi);
+ if (unlikely(fe_type >= BTRFS_NR_FILE_EXTENT_TYPES)) {
file_extent_err(leaf, slot,
"invalid type for file extent, have %u expect range [0, %u]",
- btrfs_file_extent_type(leaf, fi),
- BTRFS_NR_FILE_EXTENT_TYPES - 1);
+ fe_type, BTRFS_NR_FILE_EXTENT_TYPES - 1);
return -EUCLEAN;
}
@@ -290,10 +292,11 @@ static int check_extent_data_item(struct extent_buffer *leaf,
BTRFS_NR_COMPRESS_TYPES - 1);
return -EUCLEAN;
}
- if (unlikely(btrfs_file_extent_encryption(leaf, fi))) {
+ policy = btrfs_file_extent_encryption(leaf, fi);
+ if (unlikely(policy >= BTRFS_NR_ENCRYPTION_TYPES)) {
file_extent_err(leaf, slot,
- "invalid encryption for file extent, have %u expect 0",
- btrfs_file_extent_encryption(leaf, fi));
+ "invalid encryption for file extent, have %u expect range [0, %u]",
+ policy, BTRFS_NR_ENCRYPTION_TYPES - 1);
return -EUCLEAN;
}
if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) {
diff --git a/kernel-shared/uapi/btrfs_tree.h b/kernel-shared/uapi/btrfs_tree.h
index 1ca63711..74d307f1 100644
--- a/kernel-shared/uapi/btrfs_tree.h
+++ b/kernel-shared/uapi/btrfs_tree.h
@@ -1072,6 +1072,12 @@ enum {
BTRFS_NR_FILE_EXTENT_TYPES = 3,
};
+enum {
+ BTRFS_ENCRYPTION_NONE,
+ BTRFS_ENCRYPTION_FSCRYPT,
+ BTRFS_NR_ENCRYPTION_TYPES,
+};
+
struct btrfs_file_extent_item {
/*
* transaction id that created this extent
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v3 3/7] btrfs-progs: add inode encryption contexts
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 1/7] btrfs-progs: add new FEATURE_INCOMPAT_ENCRYPT flag Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 2/7] btrfs-progs: start tracking extent encryption context info Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents Daniel Vacek
` (5 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Recapitulates relevant parts of kernel change 'btrfs: add inode
encryption contexts'.
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
kernel-shared/uapi/btrfs_tree.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel-shared/uapi/btrfs_tree.h b/kernel-shared/uapi/btrfs_tree.h
index 74d307f1..b4532237 100644
--- a/kernel-shared/uapi/btrfs_tree.h
+++ b/kernel-shared/uapi/btrfs_tree.h
@@ -168,6 +168,9 @@
#define BTRFS_VERITY_DESC_ITEM_KEY 36
#define BTRFS_VERITY_MERKLE_ITEM_KEY 37
+#define BTRFS_FSCRYPT_INODE_CTX_KEY 41
+#define BTRFS_FSCRYPT_CTX_KEY 42
+
#define BTRFS_ORPHAN_ITEM_KEY 48
/* reserve 2-15 close to the inode for later flexibility */
@@ -428,6 +431,7 @@ static inline __u8 btrfs_dir_flags_to_ftype(__u8 flags)
#define BTRFS_INODE_NOATIME (1U << 9)
#define BTRFS_INODE_DIRSYNC (1U << 10)
#define BTRFS_INODE_COMPRESS (1U << 11)
+#define BTRFS_INODE_ENCRYPT (1U << 12)
#define BTRFS_INODE_ROOT_ITEM_INIT (1U << 31)
@@ -444,6 +448,7 @@ static inline __u8 btrfs_dir_flags_to_ftype(__u8 flags)
BTRFS_INODE_NOATIME | \
BTRFS_INODE_DIRSYNC | \
BTRFS_INODE_COMPRESS | \
+ BTRFS_INODE_ENCRYPT | \
BTRFS_INODE_ROOT_ITEM_INIT)
#define BTRFS_INODE_RO_VERITY (1U << 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (2 preceding siblings ...)
2026-07-07 14:27 ` [PATCH v3 3/7] btrfs-progs: add inode encryption contexts Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 22:40 ` Qu Wenruo
2026-07-07 14:27 ` [PATCH v3 5/7] btrfs-progs: handle fscrypt context items Daniel Vacek
` (4 subsequent siblings)
8 siblings, 1 reply; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Encrypted file extents now have the 'encryption' field set to an
encryption type. Let's print it.
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
check/main.c | 1 -
kernel-shared/print-tree.c | 7 +++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/check/main.c b/check/main.c
index 5e29e2c5..7f438302 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1778,7 +1778,6 @@ static int process_file_extent(struct btrfs_root *root,
rec->errors |= I_ERR_BAD_FILE_EXTENT;
if (extent_type == BTRFS_FILE_EXTENT_PREALLOC &&
(btrfs_file_extent_compression(eb, fi) ||
- btrfs_file_extent_encryption(eb, fi) ||
btrfs_file_extent_other_encoding(eb, fi)))
rec->errors |= I_ERR_BAD_FILE_EXTENT;
if (compression && rec->nodatasum)
diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
index 0afa3696..2c0168b0 100644
--- a/kernel-shared/print-tree.c
+++ b/kernel-shared/print-tree.c
@@ -445,11 +445,12 @@ static void print_file_extent_item(struct extent_buffer *eb,
extent_type, file_extent_type_to_str(extent_type));
if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
- printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s)\n",
+ printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s) encryption %hhu\n",
btrfs_file_extent_inline_item_len(eb, slot),
btrfs_file_extent_ram_bytes(eb, fi),
btrfs_file_extent_compression(eb, fi),
- compress_str);
+ compress_str,
+ btrfs_file_extent_encryption(eb, fi));
return;
}
if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
@@ -471,6 +472,8 @@ static void print_file_extent_item(struct extent_buffer *eb,
printf("\t\textent compression %hhu (%s)\n",
btrfs_file_extent_compression(eb, fi),
compress_str);
+ printf("\t\textent encryption %hhu\n",
+ btrfs_file_extent_encryption(eb, fi));
}
/* Caller should ensure sizeof(*ret) >= 16("DATA|TREE_BLOCK") */
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents
2026-07-07 14:27 ` [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents Daniel Vacek
@ 2026-07-07 22:40 ` Qu Wenruo
2026-07-08 4:38 ` Daniel Vacek
0 siblings, 1 reply; 15+ messages in thread
From: Qu Wenruo @ 2026-07-07 22:40 UTC (permalink / raw)
To: Daniel Vacek, David Sterba
Cc: linux-fscrypt, linux-btrfs, linux-kernel, Sweet Tea Dorminy
在 2026/7/7 23:57, Daniel Vacek 写道:
> From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
>
> Encrypted file extents now have the 'encryption' field set to an
> encryption type. Let's print it.
>
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> Signed-off-by: Daniel Vacek <neelx@suse.com>
> ---
> check/main.c | 1 -
> kernel-shared/print-tree.c | 7 +++++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/check/main.c b/check/main.c
> index 5e29e2c5..7f438302 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -1778,7 +1778,6 @@ static int process_file_extent(struct btrfs_root *root,
> rec->errors |= I_ERR_BAD_FILE_EXTENT;
> if (extent_type == BTRFS_FILE_EXTENT_PREALLOC &&
> (btrfs_file_extent_compression(eb, fi) ||
> - btrfs_file_extent_encryption(eb, fi) ||
I think this is a leaf-over change?
Thanks,
Qu
> btrfs_file_extent_other_encoding(eb, fi)))
> rec->errors |= I_ERR_BAD_FILE_EXTENT;
> if (compression && rec->nodatasum)
> diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
> index 0afa3696..2c0168b0 100644
> --- a/kernel-shared/print-tree.c
> +++ b/kernel-shared/print-tree.c
> @@ -445,11 +445,12 @@ static void print_file_extent_item(struct extent_buffer *eb,
> extent_type, file_extent_type_to_str(extent_type));
>
> if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> - printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s)\n",
> + printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s) encryption %hhu\n",
> btrfs_file_extent_inline_item_len(eb, slot),
> btrfs_file_extent_ram_bytes(eb, fi),
> btrfs_file_extent_compression(eb, fi),
> - compress_str);
> + compress_str,
> + btrfs_file_extent_encryption(eb, fi));
> return;
> }
> if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
> @@ -471,6 +472,8 @@ static void print_file_extent_item(struct extent_buffer *eb,
> printf("\t\textent compression %hhu (%s)\n",
> btrfs_file_extent_compression(eb, fi),
> compress_str);
> + printf("\t\textent encryption %hhu\n",
> + btrfs_file_extent_encryption(eb, fi));
> }
>
> /* Caller should ensure sizeof(*ret) >= 16("DATA|TREE_BLOCK") */
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents
2026-07-07 22:40 ` Qu Wenruo
@ 2026-07-08 4:38 ` Daniel Vacek
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-08 4:38 UTC (permalink / raw)
To: Qu Wenruo
Cc: David Sterba, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
On Wed, 8 Jul 2026 at 00:40, Qu Wenruo <wqu@suse.com> wrote:
> 在 2026/7/7 23:57, Daniel Vacek 写道:
> > From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> >
> > Encrypted file extents now have the 'encryption' field set to an
> > encryption type. Let's print it.
> >
> > Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> > Signed-off-by: Daniel Vacek <neelx@suse.com>
> > ---
> > check/main.c | 1 -
> > kernel-shared/print-tree.c | 7 +++++--
> > 2 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/check/main.c b/check/main.c
> > index 5e29e2c5..7f438302 100644
> > --- a/check/main.c
> > +++ b/check/main.c
> > @@ -1778,7 +1778,6 @@ static int process_file_extent(struct btrfs_root *root,
> > rec->errors |= I_ERR_BAD_FILE_EXTENT;
> > if (extent_type == BTRFS_FILE_EXTENT_PREALLOC &&
> > (btrfs_file_extent_compression(eb, fi) ||
> > - btrfs_file_extent_encryption(eb, fi) ||
>
> I think this is a leaf-over change?
For now it is to match the kernel part to allow for wider testing in
the open. If we decide to change the kernel we can revert this later.
--nX
> Thanks,
> Qu
>
> > btrfs_file_extent_other_encoding(eb, fi)))
> > rec->errors |= I_ERR_BAD_FILE_EXTENT;
> > if (compression && rec->nodatasum)
> > diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
> > index 0afa3696..2c0168b0 100644
> > --- a/kernel-shared/print-tree.c
> > +++ b/kernel-shared/print-tree.c
> > @@ -445,11 +445,12 @@ static void print_file_extent_item(struct extent_buffer *eb,
> > extent_type, file_extent_type_to_str(extent_type));
> >
> > if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> > - printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s)\n",
> > + printf("\t\tinline extent data size %u ram_bytes %llu compression %hhu (%s) encryption %hhu\n",
> > btrfs_file_extent_inline_item_len(eb, slot),
> > btrfs_file_extent_ram_bytes(eb, fi),
> > btrfs_file_extent_compression(eb, fi),
> > - compress_str);
> > + compress_str,
> > + btrfs_file_extent_encryption(eb, fi));
> > return;
> > }
> > if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
> > @@ -471,6 +472,8 @@ static void print_file_extent_item(struct extent_buffer *eb,
> > printf("\t\textent compression %hhu (%s)\n",
> > btrfs_file_extent_compression(eb, fi),
> > compress_str);
> > + printf("\t\textent encryption %hhu\n",
> > + btrfs_file_extent_encryption(eb, fi));
> > }
> >
> > /* Caller should ensure sizeof(*ret) >= 16("DATA|TREE_BLOCK") */
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 5/7] btrfs-progs: handle fscrypt context items
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (3 preceding siblings ...)
2026-07-07 14:27 ` [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking Daniel Vacek
` (3 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Encrypted inodes have a new associated item, the fscrypt context, which
can be printed as a pure hex string in dump-tree.
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
check/main.c | 2 ++
kernel-shared/print-tree.c | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/check/main.c b/check/main.c
index 7f438302..9447b01e 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1896,6 +1896,8 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb,
break;
case BTRFS_VERITY_DESC_ITEM_KEY:
case BTRFS_VERITY_MERKLE_ITEM_KEY:
+ case BTRFS_FSCRYPT_INODE_CTX_KEY:
+ case BTRFS_FSCRYPT_CTX_KEY:
break;
default:
error("unknown key (%llu %u %llu) found in leaf %llu",
diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
index 2c0168b0..6a4eee48 100644
--- a/kernel-shared/print-tree.c
+++ b/kernel-shared/print-tree.c
@@ -117,6 +117,20 @@ static void print_dir_item(struct extent_buffer *eb, u32 size,
}
}
+static void print_fscrypt_context(struct extent_buffer *eb, int slot)
+{
+ int i;
+ unsigned long ptr = btrfs_item_ptr_offset(eb, slot);
+ u32 item_size = btrfs_item_size(eb, slot);
+ u8 ctx_buf[item_size];
+
+ read_extent_buffer(eb, ctx_buf, ptr, item_size);
+ printf("\t\tvalue: ");
+ for(i = 0; i < item_size; i++)
+ printf("%02x", ctx_buf[i]);
+ printf("\n");
+}
+
static void print_inode_extref_item(struct extent_buffer *eb, u32 size,
struct btrfs_inode_extref *extref)
{
@@ -741,6 +755,8 @@ void print_key_type(FILE *stream, u64 objectid, u8 type)
[BTRFS_DIR_LOG_ITEM_KEY] = "DIR_LOG_ITEM",
[BTRFS_DIR_LOG_INDEX_KEY] = "DIR_LOG_INDEX",
[BTRFS_XATTR_ITEM_KEY] = "XATTR_ITEM",
+ [BTRFS_FSCRYPT_INODE_CTX_KEY] = "FSCRYPT_INODE_CTX",
+ [BTRFS_FSCRYPT_CTX_KEY] = "FSCRYPT_CTX",
[BTRFS_VERITY_DESC_ITEM_KEY] = "VERITY_DESC_ITEM",
[BTRFS_VERITY_MERKLE_ITEM_KEY] = "VERITY_MERKLE_ITEM",
[BTRFS_ORPHAN_ITEM_KEY] = "ORPHAN_ITEM",
@@ -1557,6 +1573,10 @@ void __btrfs_print_leaf(struct extent_buffer *eb, unsigned int mode)
case BTRFS_XATTR_ITEM_KEY:
print_dir_item(eb, item_size, ptr);
break;
+ case BTRFS_FSCRYPT_INODE_CTX_KEY:
+ case BTRFS_FSCRYPT_CTX_KEY:
+ print_fscrypt_context(eb, i);
+ break;
case BTRFS_DIR_LOG_INDEX_KEY:
case BTRFS_DIR_LOG_ITEM_KEY: {
struct btrfs_dir_log_item *dlog;
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (4 preceding siblings ...)
2026-07-07 14:27 ` [PATCH v3 5/7] btrfs-progs: handle fscrypt context items Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 22:43 ` Qu Wenruo
2026-07-07 14:27 ` [PATCH v3 7/7] btrfs-progs: recognize ENCRYPT inode item flag Daniel Vacek
` (2 subsequent siblings)
8 siblings, 1 reply; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba
Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
As part of the encryption changes, encrypted inline file extents record
their actual data length in ram_bytes, like compressed inline file
extents, while the item's length records the actual size. As such,
encrypted inline extents must be treated like compressed ones for
inode length consistency checking.
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
check/main.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/check/main.c b/check/main.c
index 9447b01e..cadcfef0 100644
--- a/check/main.c
+++ b/check/main.c
@@ -1720,9 +1720,7 @@ static int process_file_extent(struct btrfs_root *root,
u64 disk_bytenr = 0;
u64 extent_offset = 0;
u64 mask = gfs_info->sectorsize - 1;
- u32 max_inline_size = min_t(u32, mask,
- BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
- u8 compression;
+ u8 compression, encryption;
int extent_type;
int ret;
@@ -1747,25 +1745,30 @@ static int process_file_extent(struct btrfs_root *root,
fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
extent_type = btrfs_file_extent_type(eb, fi);
compression = btrfs_file_extent_compression(eb, fi);
+ encryption = btrfs_file_extent_encryption(eb, fi);
if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
- num_bytes = btrfs_file_extent_ram_bytes(eb, fi);
- if (num_bytes == 0)
+ u32 max_inline_size = min_t(u32, mask,
+ BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
+ u64 num_disk_bytes = btrfs_file_extent_inline_item_len(eb, slot);
+ u64 num_decoded_bytes = btrfs_file_extent_ram_bytes(eb, fi);
+ if (num_decoded_bytes == 0)
rec->errors |= I_ERR_BAD_FILE_EXTENT;
- if (compression) {
- if (btrfs_file_extent_inline_item_len(eb, slot) >
- max_inline_size ||
- num_bytes > gfs_info->sectorsize)
+ if (compression || encryption) {
+ if (encryption)
+ max_inline_size = min_t(u32, gfs_info->sectorsize,
+ BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
+ if (num_disk_bytes > max_inline_size ||
+ num_decoded_bytes > gfs_info->sectorsize)
rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
} else {
- if (num_bytes > max_inline_size)
+ if (num_decoded_bytes > max_inline_size)
rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
- if (btrfs_file_extent_inline_item_len(eb, slot) !=
- num_bytes)
+ if (num_disk_bytes != num_decoded_bytes)
rec->errors |= I_ERR_INLINE_RAM_BYTES_WRONG;
}
- rec->found_size += num_bytes;
- num_bytes = (num_bytes + mask) & ~mask;
+ rec->found_size += num_decoded_bytes;
+ num_bytes = (num_decoded_bytes + mask) & ~mask;
} else if (extent_type == BTRFS_FILE_EXTENT_REG ||
extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
num_bytes = btrfs_file_extent_num_bytes(eb, fi);
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking
2026-07-07 14:27 ` [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking Daniel Vacek
@ 2026-07-07 22:43 ` Qu Wenruo
2026-07-08 5:00 ` Daniel Vacek
0 siblings, 1 reply; 15+ messages in thread
From: Qu Wenruo @ 2026-07-07 22:43 UTC (permalink / raw)
To: Daniel Vacek, David Sterba
Cc: linux-fscrypt, linux-btrfs, linux-kernel, Sweet Tea Dorminy
在 2026/7/7 23:57, Daniel Vacek 写道:
> From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
>
> As part of the encryption changes, encrypted inline file extents record
> their actual data length in ram_bytes, like compressed inline file
> extents, while the item's length records the actual size. As such,
> encrypted inline extents must be treated like compressed ones for
> inode length consistency checking.
>
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> Signed-off-by: Daniel Vacek <neelx@suse.com>
> ---
> check/main.c | 31 +++++++++++++++++--------------
> 1 file changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/check/main.c b/check/main.c
> index 9447b01e..cadcfef0 100644
> --- a/check/main.c
> +++ b/check/main.c
> @@ -1720,9 +1720,7 @@ static int process_file_extent(struct btrfs_root *root,
> u64 disk_bytenr = 0;
> u64 extent_offset = 0;
> u64 mask = gfs_info->sectorsize - 1;
> - u32 max_inline_size = min_t(u32, mask,
> - BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
> - u8 compression;
> + u8 compression, encryption;
> int extent_type;
> int ret;
>
> @@ -1747,25 +1745,30 @@ static int process_file_extent(struct btrfs_root *root,
> fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
> extent_type = btrfs_file_extent_type(eb, fi);
> compression = btrfs_file_extent_compression(eb, fi);
> + encryption = btrfs_file_extent_encryption(eb, fi);
>
> if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> - num_bytes = btrfs_file_extent_ram_bytes(eb, fi);
> - if (num_bytes == 0)
> + u32 max_inline_size = min_t(u32, mask,
> + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
> + u64 num_disk_bytes = btrfs_file_extent_inline_item_len(eb, slot);
> + u64 num_decoded_bytes = btrfs_file_extent_ram_bytes(eb, fi);
> + if (num_decoded_bytes == 0)
> rec->errors |= I_ERR_BAD_FILE_EXTENT;
> - if (compression) {
> - if (btrfs_file_extent_inline_item_len(eb, slot) >
> - max_inline_size ||
> - num_bytes > gfs_info->sectorsize)
> + if (compression || encryption) {
> + if (encryption)
> + max_inline_size = min_t(u32, gfs_info->sectorsize,
> + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
The change looks good to me now.
However I'm just curious, is it possible to limit the encrypted data
size to sectorsize-1?
Or it is some fscrypt limit internal requiring a power-of-2 size or just
lack of interface?
Anyway I won't object this new change.
Thanks,
Qu
> + if (num_disk_bytes > max_inline_size ||
> + num_decoded_bytes > gfs_info->sectorsize)
> rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
> } else {
> - if (num_bytes > max_inline_size)
> + if (num_decoded_bytes > max_inline_size)
> rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
> - if (btrfs_file_extent_inline_item_len(eb, slot) !=
> - num_bytes)
> + if (num_disk_bytes != num_decoded_bytes)
> rec->errors |= I_ERR_INLINE_RAM_BYTES_WRONG;
> }
> - rec->found_size += num_bytes;
> - num_bytes = (num_bytes + mask) & ~mask;
> + rec->found_size += num_decoded_bytes;
> + num_bytes = (num_decoded_bytes + mask) & ~mask;
> } else if (extent_type == BTRFS_FILE_EXTENT_REG ||
> extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
> num_bytes = btrfs_file_extent_num_bytes(eb, fi);
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking
2026-07-07 22:43 ` Qu Wenruo
@ 2026-07-08 5:00 ` Daniel Vacek
2026-07-08 5:07 ` Qu Wenruo
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Vacek @ 2026-07-08 5:00 UTC (permalink / raw)
To: Qu Wenruo
Cc: David Sterba, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
On Wed, 8 Jul 2026 at 00:43, Qu Wenruo <wqu@suse.com> wrote:
> 在 2026/7/7 23:57, Daniel Vacek 写道:
> > From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> >
> > As part of the encryption changes, encrypted inline file extents record
> > their actual data length in ram_bytes, like compressed inline file
> > extents, while the item's length records the actual size. As such,
> > encrypted inline extents must be treated like compressed ones for
> > inode length consistency checking.
> >
> > Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> > Signed-off-by: Daniel Vacek <neelx@suse.com>
> > ---
> > check/main.c | 31 +++++++++++++++++--------------
> > 1 file changed, 17 insertions(+), 14 deletions(-)
> >
> > diff --git a/check/main.c b/check/main.c
> > index 9447b01e..cadcfef0 100644
> > --- a/check/main.c
> > +++ b/check/main.c
> > @@ -1720,9 +1720,7 @@ static int process_file_extent(struct btrfs_root *root,
> > u64 disk_bytenr = 0;
> > u64 extent_offset = 0;
> > u64 mask = gfs_info->sectorsize - 1;
> > - u32 max_inline_size = min_t(u32, mask,
> > - BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
> > - u8 compression;
> > + u8 compression, encryption;
> > int extent_type;
> > int ret;
> >
> > @@ -1747,25 +1745,30 @@ static int process_file_extent(struct btrfs_root *root,
> > fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
> > extent_type = btrfs_file_extent_type(eb, fi);
> > compression = btrfs_file_extent_compression(eb, fi);
> > + encryption = btrfs_file_extent_encryption(eb, fi);
> >
> > if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
> > - num_bytes = btrfs_file_extent_ram_bytes(eb, fi);
> > - if (num_bytes == 0)
> > + u32 max_inline_size = min_t(u32, mask,
> > + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
> > + u64 num_disk_bytes = btrfs_file_extent_inline_item_len(eb, slot);
> > + u64 num_decoded_bytes = btrfs_file_extent_ram_bytes(eb, fi);
> > + if (num_decoded_bytes == 0)
> > rec->errors |= I_ERR_BAD_FILE_EXTENT;
> > - if (compression) {
> > - if (btrfs_file_extent_inline_item_len(eb, slot) >
> > - max_inline_size ||
> > - num_bytes > gfs_info->sectorsize)
> > + if (compression || encryption) {
> > + if (encryption)
> > + max_inline_size = min_t(u32, gfs_info->sectorsize,
> > + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
>
> The change looks good to me now.
>
> However I'm just curious, is it possible to limit the encrypted data
> size to sectorsize-1?
>
> Or it is some fscrypt limit internal requiring a power-of-2 size or just
> lack of interface?
The encrypted data has the granularity of the cipher block size. With
AES, it's 16 bytes. Hence why.
Eventually the best we could do would be sectorsize-16. But then, if
the cipher changed in the future...
--nX
> Anyway I won't object this new change.
>
> Thanks,
> Qu
>
> > + if (num_disk_bytes > max_inline_size ||
> > + num_decoded_bytes > gfs_info->sectorsize)
> > rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
> > } else {
> > - if (num_bytes > max_inline_size)
> > + if (num_decoded_bytes > max_inline_size)
> > rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
> > - if (btrfs_file_extent_inline_item_len(eb, slot) !=
> > - num_bytes)
> > + if (num_disk_bytes != num_decoded_bytes)
> > rec->errors |= I_ERR_INLINE_RAM_BYTES_WRONG;
> > }
> > - rec->found_size += num_bytes;
> > - num_bytes = (num_bytes + mask) & ~mask;
> > + rec->found_size += num_decoded_bytes;
> > + num_bytes = (num_decoded_bytes + mask) & ~mask;
> > } else if (extent_type == BTRFS_FILE_EXTENT_REG ||
> > extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
> > num_bytes = btrfs_file_extent_num_bytes(eb, fi);
>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking
2026-07-08 5:00 ` Daniel Vacek
@ 2026-07-08 5:07 ` Qu Wenruo
0 siblings, 0 replies; 15+ messages in thread
From: Qu Wenruo @ 2026-07-08 5:07 UTC (permalink / raw)
To: Daniel Vacek, Qu Wenruo
Cc: David Sterba, linux-fscrypt, linux-btrfs, linux-kernel,
Sweet Tea Dorminy
在 2026/7/8 14:30, Daniel Vacek 写道:
> On Wed, 8 Jul 2026 at 00:43, Qu Wenruo <wqu@suse.com> wrote:
>> 在 2026/7/7 23:57, Daniel Vacek 写道:
>>> From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
>>>
>>> As part of the encryption changes, encrypted inline file extents record
>>> their actual data length in ram_bytes, like compressed inline file
>>> extents, while the item's length records the actual size. As such,
>>> encrypted inline extents must be treated like compressed ones for
>>> inode length consistency checking.
>>>
>>> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
>>> Signed-off-by: Daniel Vacek <neelx@suse.com>
>>> ---
>>> check/main.c | 31 +++++++++++++++++--------------
>>> 1 file changed, 17 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/check/main.c b/check/main.c
>>> index 9447b01e..cadcfef0 100644
>>> --- a/check/main.c
>>> +++ b/check/main.c
>>> @@ -1720,9 +1720,7 @@ static int process_file_extent(struct btrfs_root *root,
>>> u64 disk_bytenr = 0;
>>> u64 extent_offset = 0;
>>> u64 mask = gfs_info->sectorsize - 1;
>>> - u32 max_inline_size = min_t(u32, mask,
>>> - BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
>>> - u8 compression;
>>> + u8 compression, encryption;
>>> int extent_type;
>>> int ret;
>>>
>>> @@ -1747,25 +1745,30 @@ static int process_file_extent(struct btrfs_root *root,
>>> fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
>>> extent_type = btrfs_file_extent_type(eb, fi);
>>> compression = btrfs_file_extent_compression(eb, fi);
>>> + encryption = btrfs_file_extent_encryption(eb, fi);
>>>
>>> if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
>>> - num_bytes = btrfs_file_extent_ram_bytes(eb, fi);
>>> - if (num_bytes == 0)
>>> + u32 max_inline_size = min_t(u32, mask,
>>> + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
>>> + u64 num_disk_bytes = btrfs_file_extent_inline_item_len(eb, slot);
>>> + u64 num_decoded_bytes = btrfs_file_extent_ram_bytes(eb, fi);
>>> + if (num_decoded_bytes == 0)
>>> rec->errors |= I_ERR_BAD_FILE_EXTENT;
>>> - if (compression) {
>>> - if (btrfs_file_extent_inline_item_len(eb, slot) >
>>> - max_inline_size ||
>>> - num_bytes > gfs_info->sectorsize)
>>> + if (compression || encryption) {
>>> + if (encryption)
>>> + max_inline_size = min_t(u32, gfs_info->sectorsize,
>>> + BTRFS_MAX_INLINE_DATA_SIZE(gfs_info));
>>
>> The change looks good to me now.
>>
>> However I'm just curious, is it possible to limit the encrypted data
>> size to sectorsize-1?
>>
>> Or it is some fscrypt limit internal requiring a power-of-2 size or just
>> lack of interface?
>
> The encrypted data has the granularity of the cipher block size. With
> AES, it's 16 bytes. Hence why.
> Eventually the best we could do would be sectorsize-16. But then, if
> the cipher changed in the future...
Thanks a lot, that explains the reason why we can not follow the old
sectorsize - 1 limit.
Thanks,
Qu
>
> --nX
>
>> Anyway I won't object this new change.
>>
>> Thanks,
>> Qu
>>
>>> + if (num_disk_bytes > max_inline_size ||
>>> + num_decoded_bytes > gfs_info->sectorsize)
>>> rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
>>> } else {
>>> - if (num_bytes > max_inline_size)
>>> + if (num_decoded_bytes > max_inline_size)
>>> rec->errors |= I_ERR_FILE_EXTENT_TOO_LARGE;
>>> - if (btrfs_file_extent_inline_item_len(eb, slot) !=
>>> - num_bytes)
>>> + if (num_disk_bytes != num_decoded_bytes)
>>> rec->errors |= I_ERR_INLINE_RAM_BYTES_WRONG;
>>> }
>>> - rec->found_size += num_bytes;
>>> - num_bytes = (num_bytes + mask) & ~mask;
>>> + rec->found_size += num_decoded_bytes;
>>> + num_bytes = (num_decoded_bytes + mask) & ~mask;
>>> } else if (extent_type == BTRFS_FILE_EXTENT_REG ||
>>> extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
>>> num_bytes = btrfs_file_extent_num_bytes(eb, fi);
>>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 7/7] btrfs-progs: recognize ENCRYPT inode item flag
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (5 preceding siblings ...)
2026-07-07 14:27 ` [PATCH v3 6/7] btrfs-progs: check: update inline extent length checking Daniel Vacek
@ 2026-07-07 14:27 ` Daniel Vacek
2026-07-07 14:33 ` [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
2026-07-08 4:59 ` Qu Wenruo
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:27 UTC (permalink / raw)
To: David Sterba; +Cc: Daniel Vacek, linux-fscrypt, linux-btrfs, linux-kernel
Signed-off-by: Daniel Vacek <neelx@suse.com>
---
kernel-shared/print-tree.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
index 6a4eee48..cae5c6df 100644
--- a/kernel-shared/print-tree.c
+++ b/kernel-shared/print-tree.c
@@ -1012,6 +1012,7 @@ static struct readable_flag_entry inode_flags_array[] = {
DEF_INODE_FLAG_ENTRY(NOATIME),
DEF_INODE_FLAG_ENTRY(DIRSYNC),
DEF_INODE_FLAG_ENTRY(COMPRESS),
+ DEF_INODE_FLAG_ENTRY(ENCRYPT),
DEF_INODE_FLAG_ENTRY(ROOT_ITEM_INIT),
};
static const int inode_flags_num = ARRAY_SIZE(inode_flags_array);
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 0/7] btrfs-progs: fscrypt updates
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (6 preceding siblings ...)
2026-07-07 14:27 ` [PATCH v3 7/7] btrfs-progs: recognize ENCRYPT inode item flag Daniel Vacek
@ 2026-07-07 14:33 ` Daniel Vacek
2026-07-08 4:59 ` Qu Wenruo
8 siblings, 0 replies; 15+ messages in thread
From: Daniel Vacek @ 2026-07-07 14:33 UTC (permalink / raw)
To: David Sterba, WenRuo Qu; +Cc: linux-fscrypt, linux-btrfs, linux-kernel
On Tue, 7 Jul 2026 at 16:27, Daniel Vacek <neelx@suse.com> wrote:
> This series is a rebase of an older set of fscrypt related changes from
> Sweet Tea Dorminy and Josef Bacik found here:
> https://github.com/josefbacik/btrfs-progs/tree/fscrypt
>
> It passed all my tests. Hopefully nothing blows. Enjoy testing.
>
> v3:
> * dropped first patch and improved inline extent length checking
> * correctly squashed the context key definitions into "btrfs-progs: add
> inode encryption contexts"
> * inline extents also show the encryption field now in tree dump
And I forgot to explicitly CC Qu as most of these changes are thanks
to his review of v2.
--nX
> v2: https://lore.kernel.org/linux-btrfs/20260624165144.556908-1-neelx@suse.com/
> * works with v7 of the kernel fscrypt series
> * the on-disk format changed and parts of the series had to be reworked
> - particularly the encryption context is now stored as dedicated item
> and not glued onto extent data item
> * also parses the ENCRYPT inode item flag
>
> Daniel Vacek (1):
> btrfs-progs: recognize ENCRYPT inode item flag
>
> Sweet Tea Dorminy (6):
> btrfs-progs: add new FEATURE_INCOMPAT_ENCRYPT flag
> btrfs-progs: start tracking extent encryption context info
> btrfs-progs: add inode encryption contexts
> btrfs-progs: print encryptin type field of file extents
> btrfs-progs: handle fscrypt context items
> btrfs-progs: check: update inline extent length checking
>
> check/main.c | 34 ++++++++++++++++++---------------
> kernel-shared/ctree.h | 1 +
> kernel-shared/print-tree.c | 28 +++++++++++++++++++++++++--
> kernel-shared/tree-checker.c | 17 ++++++++++-------
> kernel-shared/uapi/btrfs.h | 1 +
> kernel-shared/uapi/btrfs_tree.h | 11 +++++++++++
> libbtrfsutil/btrfs.h | 1 +
> 7 files changed, 69 insertions(+), 24 deletions(-)
>
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v3 0/7] btrfs-progs: fscrypt updates
2026-07-07 14:27 [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
` (7 preceding siblings ...)
2026-07-07 14:33 ` [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
@ 2026-07-08 4:59 ` Qu Wenruo
8 siblings, 0 replies; 15+ messages in thread
From: Qu Wenruo @ 2026-07-08 4:59 UTC (permalink / raw)
To: Daniel Vacek, David Sterba; +Cc: linux-fscrypt, linux-btrfs, linux-kernel
在 2026/7/7 23:57, Daniel Vacek 写道:
> This series is a rebase of an older set of fscrypt related changes from
> Sweet Tea Dorminy and Josef Bacik found here:
> https://github.com/josefbacik/btrfs-progs/tree/fscrypt
>
> It passed all my tests. Hopefully nothing blows. Enjoy testing.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Although I still think some corner cases may change in the future, but
considering it's already hidden behind experimental, we should have
plenty time before pushing it to end users.
Will push it to devel after a full selftest.
Thanks,
Qu
>
> v3:
> * dropped first patch and improved inline extent length checking
> * correctly squashed the context key definitions into "btrfs-progs: add
> inode encryption contexts"
> * inline extents also show the encryption field now in tree dump
>
> v2: https://lore.kernel.org/linux-btrfs/20260624165144.556908-1-neelx@suse.com/
> * works with v7 of the kernel fscrypt series
> * the on-disk format changed and parts of the series had to be reworked
> - particularly the encryption context is now stored as dedicated item
> and not glued onto extent data item
> * also parses the ENCRYPT inode item flag
>
> Daniel Vacek (1):
> btrfs-progs: recognize ENCRYPT inode item flag
>
> Sweet Tea Dorminy (6):
> btrfs-progs: add new FEATURE_INCOMPAT_ENCRYPT flag
> btrfs-progs: start tracking extent encryption context info
> btrfs-progs: add inode encryption contexts
> btrfs-progs: print encryptin type field of file extents
> btrfs-progs: handle fscrypt context items
> btrfs-progs: check: update inline extent length checking
>
> check/main.c | 34 ++++++++++++++++++---------------
> kernel-shared/ctree.h | 1 +
> kernel-shared/print-tree.c | 28 +++++++++++++++++++++++++--
> kernel-shared/tree-checker.c | 17 ++++++++++-------
> kernel-shared/uapi/btrfs.h | 1 +
> kernel-shared/uapi/btrfs_tree.h | 11 +++++++++++
> libbtrfsutil/btrfs.h | 1 +
> 7 files changed, 69 insertions(+), 24 deletions(-)
>
^ permalink raw reply [flat|nested] 15+ messages in thread