mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/filesystems: expect EINVAL from overlayfs in fscontext_ns_test
@ 2026-09-29  1:00 Danish Khateeb
  0 siblings, 0 replies; only message in thread
From: Danish Khateeb @ 2026-09-29  1:00 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Miklos Szeredi, Amir Goldstein, Shuah Khan, linux-fsdevel,
	linux-unionfs, linux-kselftest, linux-kernel, Danish Khateeb

Since commit a518e63c3775 ("ovl: return EINVAL instead of EIO in case of
mismatched user_ns"), overlayfs refuses a context created in another
user namespace with EINVAL, like binfmt_misc does. The test still
expects EIO, so it fails:

  # fscontext_ns_test.c:208:create_from_descendant_userns:Expected variant->expected_errno (5) == errno (22)
  #          FAIL  fscontext_ns.overlay.create_from_descendant_userns

Expect EINVAL.

Fixes: a518e63c3775 ("ovl: return EINVAL instead of EIO in case of mismatched user_ns")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
---

Notes:
    Tested on next-20260925 in QEMU: fails as above without this patch, and
    all 3 tests pass with it.

 .../selftests/filesystems/fscontext_ns/fscontext_ns_test.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test.c b/tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test.c
index 0f30a3e6e197..535bf1f4e1a3 100644
--- a/tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test.c
+++ b/tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test.c
@@ -193,7 +193,7 @@ FIXTURE_VARIANT_ADD(fscontext_ns, binfmt_misc) {
 
 FIXTURE_VARIANT_ADD(fscontext_ns, overlay) {
 	.fsname = "overlay",
-	.expected_errno = EIO,
+	.expected_errno = EINVAL,
 };
 
 TEST_F(fscontext_ns, create_from_descendant_userns)

base-commit: 6812ce4e4379ffc99c52401ec28f0d7ffbc36206
-- 
2.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-29  1:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29  1:00 [PATCH] selftests/filesystems: expect EINVAL from overlayfs in fscontext_ns_test Danish Khateeb

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

all inboxes | Powered by JetHome®