Skip to contentSkip to conversation

selftests/filesystems: expect EINVAL from overlayfs in fscontext_ns_test

PATCH New Danish Khateeb 1 participant 1 message Sep 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/filesystems: expect EINVAL from overlayfs in fscontext_ns_test

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

---

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(-)
tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test.c +1 -1
index 0f30a3e6e197..535bf1f4e1a3 100644
@@ -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

Signature · 1 line
2.55.0