idmapped-mounts: always run generic vfs tests
authorChristian Brauner <brauner@kernel.org>
Tue, 18 Jan 2022 14:13:24 +0000 (15:13 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 23 Jan 2022 14:25:12 +0000 (22:25 +0800)
commitd8dee1222ecdfa1cff1386a61248e587eb3b275d
tree29ee2a6fded83a0b0982b560e7c720ce0e9e2620
parentbd4746b14ae607b09cf5d99573af91f17895a69f
idmapped-mounts: always run generic vfs tests

Make it possible to always run all the tests in the testsuite that don't
require idmapped mounts. Now all filesystems can benefit from the
generic vfs tests that we currently implement. This means setgid
inheritance and other tests will be run for all filesystems not matter
if they support idmapped mounts or not.

To this end, the binary makes use of the fs_allow_idmap() helper we
introduced earlier to dynamically determine whether the underlying
filesystem supports idmapped mounts or not. It is therefore safe for
callers to call the binary even if the tested filesystem doesn't support
idmapped mounts.

Most of the tests that call the idmapped mount binary require idmapped
mount support and so they will continue to call
_require_idmapped_mounts. This will also ensure that we log a proper
message about skipping a whole test.

However, the generic/633 test includes idmapped mount specific and
generic tests. The generic tests can and should always be executed as
they test core vfs functionality that isn't tested anywhere else in
fstests. So here we can remove the _require_idmapped_mounts check from
the test and rely on the binary doing the right thing.

Link: https://lore.kernel.org/r/20220113132421.865002-2-brauner@kernel.org
Cc: Seth Forshee <sforshee@digitalocean.com>
Cc: Eryu Guan <guaneryu@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: fstests@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/idmapped-mounts/idmapped-mounts.c
tests/generic/633