Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Daniel Vacek <neelx@suse.com>
To: David Sterba <dsterba@suse.com>
Cc: Daniel Vacek <neelx@suse.com>,
	linux-fscrypt@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Subject: [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents
Date: Tue,  7 Jul 2026 16:27:33 +0200	[thread overview]
Message-ID: <20260707142736.2330146-5-neelx@suse.com> (raw)
In-Reply-To: <20260707142736.2330146-1-neelx@suse.com>

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


  parent reply	other threads:[~2026-07-07 14:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [PATCH v3 3/7] btrfs-progs: add inode encryption contexts Daniel Vacek
2026-07-07 14:27 ` Daniel Vacek [this message]
2026-07-07 22:40   ` [PATCH v3 4/7] btrfs-progs: print encryptin type field of file extents Qu Wenruo
2026-07-08  4:38     ` Daniel Vacek
2026-07-07 14:27 ` [PATCH v3 5/7] btrfs-progs: handle fscrypt context items Daniel Vacek
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
2026-07-08  5:07       ` Qu Wenruo
2026-07-07 14:27 ` [PATCH v3 7/7] btrfs-progs: recognize ENCRYPT inode item flag Daniel Vacek
2026-07-07 14:33 ` [PATCH v3 0/7] btrfs-progs: fscrypt updates Daniel Vacek
2026-07-08  4:59 ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260707142736.2330146-5-neelx@suse.com \
    --to=neelx@suse.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sweettea-kernel@dorminy.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox