linux-stable/fs/ext4
Eric Biggers 7919ee7151 ext4: only allow test_dummy_encryption when supported
commit 5f41fdaea6 upstream.

Make the test_dummy_encryption mount option require that the encrypt
feature flag be already enabled on the filesystem, rather than
automatically enabling it.  Practically, this means that "-O encrypt"
will need to be included in MKFS_OPTIONS when running xfstests with the
test_dummy_encryption mount option.  (ext4/053 also needs an update.)

Moreover, as long as the preconditions for test_dummy_encryption are
being tightened anyway, take the opportunity to start rejecting it when
!CONFIG_FS_ENCRYPTION rather than ignoring it.

The motivation for requiring the encrypt feature flag is that:

- Having the filesystem auto-enable feature flags is problematic, as it
  bypasses the usual sanity checks.  The specific issue which came up
  recently is that in kernel versions where ext4 supports casefold but
  not encrypt+casefold (v5.1 through v5.10), the kernel will happily add
  the encrypt flag to a filesystem that has the casefold flag, making it
  unmountable -- but only for subsequent mounts, not the initial one.
  This confused the casefold support detection in xfstests, causing
  generic/556 to fail rather than be skipped.

- The xfstests-bld test runners (kvm-xfstests et al.) already use the
  required mkfs flag, so they will not be affected by this change.  Only
  users of test_dummy_encryption alone will be affected.  But, this
  option has always been for testing only, so it should be fine to
  require that the few users of this option update their test scripts.

- f2fs already requires it (for its equivalent feature flag).

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Link: https://lore.kernel.org/r/20220519204437.61645-1-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-09 10:26:31 +02:00
..
.kunitconfig
Kconfig
Makefile ext4: Move orphan inode handling into a separate file 2021-08-30 23:36:51 -04:00
acl.c fs/ext4: fix comments mentioning i_mutex 2022-02-03 10:57:53 -05:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
balloc.c ext4: flush background discard kwork when retry allocation 2021-08-30 23:35:53 -04:00
bitmap.c
block_validity.c
dir.c ext4: remove unnecessary 'offset' assignment 2022-01-10 13:25:56 -05:00
ext4.h ext4: only allow test_dummy_encryption when supported 2022-06-09 10:26:31 +02:00
ext4_extents.h ext4: fix sparse warnings 2021-08-30 23:36:50 -04:00
ext4_jbd2.c ext4: fix null-ptr-deref in '__ext4_journal_ensure_credits' 2022-01-10 13:25:55 -05:00
ext4_jbd2.h fs/ext4: fix comments mentioning i_mutex 2022-02-03 10:57:53 -05:00
extents.c ext4: fix bug_on in __es_tree_search 2022-06-09 10:26:19 +02:00
extents_status.c
extents_status.h
fast_commit.c ext4: fix incorrect type issue during replay_del_range 2022-02-03 10:57:53 -05:00
fast_commit.h ext4: simplify updating of fast commit stats 2021-12-23 18:13:25 -05:00
file.c ext4: use ext4_journal_start/stop for fast commit transactions 2021-12-23 18:13:25 -05:00
fsmap.c
fsmap.h
fsync.c
hash.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
ialloc.c ext4: Support for checksumming from journal triggers 2021-08-30 23:36:50 -04:00
indirect.c fs/ext4: fix comments mentioning i_mutex 2022-02-03 10:57:53 -05:00
inline.c ext4: fix bug_on in ext4_writepages 2022-06-09 10:26:19 +02:00
inode-test.c
inode.c ext4: fix warning in ext4_handle_inode_extension 2022-06-09 10:26:19 +02:00
ioctl.c ext4: update the cached overhead value in the superblock 2022-04-27 14:41:16 +02:00
mballoc.c ext4: mark group as trimmed only if it was fully scanned 2022-06-09 10:26:18 +02:00
mballoc.h
migrate.c fs/ext4: fix comments mentioning i_mutex 2022-02-03 10:57:53 -05:00
mmp.c
move_extent.c ext4: remove redundant o_start statement 2022-01-10 13:25:56 -05:00
namei.c ext4: avoid cycles in directory h-tree 2022-06-09 10:26:19 +02:00
orphan.c fs/ext4: fix comments mentioning i_mutex 2022-02-03 10:57:53 -05:00
page-io.c ext4: fix symlink file size not match to file content 2022-04-27 14:41:16 +02:00
readpage.c mm: remove cleancache 2022-01-22 08:33:38 +02:00
resize.c ext4: implement support for get/set fs label 2022-01-10 13:25:55 -05:00
super.c ext4: only allow test_dummy_encryption when supported 2022-06-09 10:26:31 +02:00
symlink.c
sysfs.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
truncate.h
verity.c
xattr.c ext4: fast commit may not fallback for ineligible commit 2022-02-03 10:56:39 -05:00
xattr.h
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c