FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH v1] common/encrypt: Do not run _verify_ciphertext_for_encryption_policy on compressed FS
@ 2025-09-04  8:54 Jan Prusakowski
  2025-09-04 17:39 ` Eric Biggers
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Prusakowski @ 2025-09-04  8:54 UTC (permalink / raw)
  To: Zorro Lang, Chao Yu, fstests
  Cc: jaegeuk, linux-f2fs-devel, Eric Biggers, Jan Prusakowski

_verify_ciphertext_for_encryption_policy() checks if encryption works
correctly by reading encrypted file's contents directly from a block device and
comparing it to a known good ciphertext.

This, however, won't work if the file systems is also compressed. So this patch
disables tests using this function when a compressed FS is used.

Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
---
 common/config  | 1 +
 common/encrypt | 4 ++++
 common/f2fs    | 7 +++++++
 common/rc      | 3 +++
 4 files changed, 15 insertions(+)

diff --git a/common/config b/common/config
index 22b52432..1420e35d 100644
--- a/common/config
+++ b/common/config
@@ -509,6 +509,7 @@ _source_specific_fs()
 		;;
 	f2fs)
 		[ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+		. ./common/f2fs
 		;;
 	nfs)
 		. ./common/nfs
diff --git a/common/encrypt b/common/encrypt
index d4f6e3dc..43ec349b 100644
--- a/common/encrypt
+++ b/common/encrypt
@@ -989,6 +989,10 @@ _verify_ciphertext_for_encryption_policy()
 	fi
 	set_encpolicy_args=${set_encpolicy_args# }
 
+
+	# _verify_ciphertext_for_encryption_policy will fail if the FS is compressed.
+	_require_no_compress
+
 	_require_scratch_encryption $set_encpolicy_args -f $policy_flags
 	if $hw_wrapped_key; then
 		_require_hw_wrapped_key_support $SCRATCH_DEV
diff --git a/common/f2fs b/common/f2fs
index 1b39d8ce..c46e2aa2 100644
--- a/common/f2fs
+++ b/common/f2fs
@@ -25,3 +25,10 @@ _require_scratch_f2fs_compression()
 		_scratch_unmount
 	fi
 }
+
+_require_f2fs_no_compress()
+{
+	if _normalize_mount_options "$MOUNT_OPTIONS" | grep -q "compress"; then
+		_notrun "This test requires no compression enabled"
+	fi
+}
\ No newline at end of file
diff --git a/common/rc b/common/rc
index 81587dad..882e0588 100644
--- a/common/rc
+++ b/common/rc
@@ -2112,6 +2112,9 @@ _require_no_compress()
 	btrfs)
 		_require_btrfs_no_compress
 		;;
+	f2fs)
+		_require_f2fs_no_compress
+		;;
 	*)
 		;;
 	esac
-- 
2.51.0.355.g5224444f11-goog


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

end of thread, other threads:[~2025-09-12 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04  8:54 [PATCH v1] common/encrypt: Do not run _verify_ciphertext_for_encryption_policy on compressed FS Jan Prusakowski
2025-09-04 17:39 ` Eric Biggers
2025-09-12 13:11   ` Jan Prusakowski

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