Re: [PATCH v2 1/1] statmount: accept fd as a parameter

Bhavik Sachdev
2025-10-22T15:39:52Z

On Tue Oct 21, 2025 at 5:41 PM IST, Christian Brauner wrote:
> Hm, do you really need a new field? You could just use the @spare
> parameter in struct mnt_id_req. It's currently validated of not being
> allowed to be non-zero in copy_mnt_id_req() which is used by both
> statmount() and listmount().
>
> I think you could just reuse it for this purpose in statmount(). And
> then maybe the flag should be STATMOUNT_BY_FD?
>
We made a new field because we thought @spare is already being used (or
will have a future use?). grab_requested_mnt_ns uses @spare as a mount
namespace fd [1], but we also only allow @spare to be 0, so I don't
really understand whats happening here, is this functionality disabled?
> Otherwise I think this could work.
>
Thanks, Christian! I will send a new patch with all your requested
changes.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7b9d14af8777ac439bbfa9ac73a12a6d85289e7e