_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 <jprusakow...@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



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to