Re: [PATCH] fs/namespace: correctly handle errors returned by grab_requested_mnt_ns

Mark Brown
2025-11-24T11:23:19Z

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

On Sun, Nov 23, 2025 at 07:15:16AM -0800, Andrei Vagin wrote:
> On Sun, Nov 23, 2025 at 4:51 AM Mark Brown <broonie@kernel.org> wrote:

> > listmount04.c:128: TFAIL: invalid mnt_id_req.spare expected EINVAL: EBADF (9)

> The merged patch is slightly different from what you can see on the
> mailing list, so it's better to look at commit 78f0e33cd6c93
> ("fs/namespace: correctly handle errors returned by
> grab_requested_mnt_ns") to understand what is going on here.

> With this patch, the spare field can be used as the `mnt_ns_fd`. EINVAL
> is returned if both mnt_ns_fd and mnt_ns_id are set. A non-zero
> mnt_ns_fd (the old spare) is interpreted as a namespace file descriptor.

I can see what's happening - the question is if the test failure it
triggers is a problem in the kernel or in the test.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]