Re: [PATCH v2] nsfs: fix wrong error code returned for pidns ioctls

From: Christian Brauner

Date: Mon May 11 2026 - 10:30:07 EST


On Thu, 07 May 2026 19:23:01 +0800, Zhihao Cheng wrote:
> When executing NS_GET_PID_FROM_PIDNS (or similar pidns ioctls), if the
> target task cannot be found in the corresponding pid_ns, the error code
> should be ESRCH instead of ENOTTY.
>
> This bug was introduced when the extensible ioctl handling was added.
> Without proper return, ret would be overwritten by the default case in
> the extensible ioctl switch statement.
>
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes 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.fixes

[1/1] nsfs: fix wrong error code returned for pidns ioctls
https://git.kernel.org/vfs/vfs/c/725ecd80688b