Some older kernels support ext4 file systems with encryption enabled, and with casefold enabled, but not file systems have both encryption *and* casefolding enabled. On those kernels, generic/556 will fail. Fortunately, we can test if ext4 supports encrypted casefold via the presence of /sys/fs/ext4/features/encrypted_casefold. Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> --- common/casefold | 17 +++++++++++++++++ tests/generic/556 | 1 + 2 files changed, 18 insertions(+) diff --git a/common/casefold b/common/casefold index 9172d818..7b76b986 100644 --- a/common/casefold +++ b/common/casefold @@ -43,6 +43,23 @@ _require_scratch_casefold() _require_command "$LSATTR_PROG" lsattr } +_require_encrypted_casefold () +{ + case $FSTYP in + ext4) + if test ! -f /sys/fs/ext4/features/casefold ; then + _notrun "casefolding not supported" + fi + if test ! -f /sys/fs/ext4/features/encryption ; then + _notrun "file system encryption not supported" + fi + if test ! -f /sys/fs/ext4/features/encrypted_casefold ; then + _notrun "encrypted casefolding not supported" + fi + ;; + esac +} + _scratch_mkfs_casefold() { case $FSTYP in diff --git a/tests/generic/556 b/tests/generic/556 index 3145188c..7916a08e 100755 --- a/tests/generic/556 +++ b/tests/generic/556 @@ -16,6 +16,7 @@ status=1 # failure is thea default . ./common/attr _supported_fs generic +_require_encrypted_casefold _require_scratch_nocheck _require_scratch_casefold _require_symlinks -- 2.31.0