[PATCH 0/3] selftests/namespaces: Fix test hangs and false failures

Ricardo B. Marlière posted 3 patches 2 months, 2 weeks ago
.../selftests/namespaces/listns_efault_test.c      | 33 ++++++++++++++++++----
tools/testing/selftests/namespaces/nsid_test.c     | 14 ++++++++-
2 files changed, 40 insertions(+), 7 deletions(-)
[PATCH 0/3] selftests/namespaces: Fix test hangs and false failures
Posted by Ricardo B. Marlière 2 months, 2 weeks ago
This series addresses three reliability problems in the namespaces selftest
suite that cause tests to hang or report incorrect results.

The first patch fixes a hang in nsid_test where the grandchild process is
not reaped during fixture teardown, leaving it alive and holding the TAP
pipe write-end open so the test runner blocks indefinitely waiting for EOF.

The second and third patches fix two problems in listns_efault_test: a
waitpid(-1) race that can cause the iterator child to be consumed during
namespace cleanup (leading to an indefinite block on the subsequent targeted
waitpid), and a false FAIL verdict on kernels that do not implement listns()
(the EFAULT tests should SKIP in that case, consistent with every other
listns test that already handles ENOSYS correctly).

Assisted-by: Claude Sonnet 4.6
Signed-off-by: Ricardo B. Marliere <rbm@suse.com>
---
Ricardo B. Marlière (3):
      selftests/namespaces: Kill grandchild in nsid fixture teardown
      selftests/namespaces: Fix waitpid race in listns_efault_test cleanup
      selftests/namespaces: Skip efault tests when listns() is not available

 .../selftests/namespaces/listns_efault_test.c      | 33 ++++++++++++++++++----
 tools/testing/selftests/namespaces/nsid_test.c     | 14 ++++++++-
 2 files changed, 40 insertions(+), 7 deletions(-)
---
base-commit: bfe62a454542cfad3379f6ef5680b125f41e20f4
change-id: 20260407-selftests-namespaces_fixes-43ff47179e5c

Best regards,
--  
Ricardo B. Marlière <rbm@suse.com>

Re: [PATCH 0/3] selftests/namespaces: Fix test hangs and false failures
Posted by Christian Brauner 2 months, 1 week ago
On Tue, 07 Apr 2026 11:35:44 -0300, Ricardo B. Marlière wrote:
> This series addresses three reliability problems in the namespaces selftest
> suite that cause tests to hang or report incorrect results.
> 
> The first patch fixes a hang in nsid_test where the grandchild process is
> not reaped during fixture teardown, leaving it alive and holding the TAP
> pipe write-end open so the test runner blocks indefinitely waiting for EOF.
> 
> [...]

Applied to the vfs-7.2.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.2.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.2.misc

[1/3] selftests/namespaces: Kill grandchild in nsid fixture teardown
      https://git.kernel.org/vfs/vfs/c/c87e78c29c78
[2/3] selftests/namespaces: Fix waitpid race in listns_efault_test cleanup
      https://git.kernel.org/vfs/vfs/c/f079c63caa7c
[3/3] selftests/namespaces: Skip efault tests when listns() is not available
      https://git.kernel.org/vfs/vfs/c/5bdb13872094