2023-09-14 10:05:43

by Christian Brauner

[permalink] [raw]
Subject: Re: [RFC PATCH 1/3] add unique mount ID

> Yes, one concern is that humans confuse the old and the new ID.
>
> I also think it makes sense to allow the new interfaces to look up the
> mount based on either the old or the new ID. But I could be wrong

Hm, mount id recycling may happen so quickly that for service restarts
with a lot of mounts this becomes mostly useless...

> there, since that might encourage bad code. Maybe the new interface
> should only use take the new ID, which means no mixed use of
> /proc/$$/mountinfo and statmnt/listmnt.

... so I think that is indeed the better way of doing things. There's no
need to encourage userspace to mix both identifiers.


2023-09-14 12:28:27

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [RFC PATCH 1/3] add unique mount ID

On Thu, 14 Sept 2023 at 11:36, Christian Brauner <[email protected]> wrote:
>
> > Yes, one concern is that humans confuse the old and the new ID.
> >
> > I also think it makes sense to allow the new interfaces to look up the
> > mount based on either the old or the new ID. But I could be wrong
>
> Hm, mount id recycling may happen so quickly that for service restarts
> with a lot of mounts this becomes mostly useless...

Agreed. The old ID is mostly useful for human interaction.

>
> > there, since that might encourage bad code. Maybe the new interface
> > should only use take the new ID, which means no mixed use of
> > /proc/$$/mountinfo and statmnt/listmnt.
>
> ... so I think that is indeed the better way of doing things. There's no
> need to encourage userspace to mix both identifiers.

Okay.

But I'd still leave the 2^32 offset for human confusion avoidance.

Thanks,
Miklos

2023-09-15 03:13:57

by Ian Kent

[permalink] [raw]
Subject: Re: [RFC PATCH 1/3] add unique mount ID

On 14/9/23 17:43, Miklos Szeredi wrote:
> On Thu, 14 Sept 2023 at 11:36, Christian Brauner <[email protected]> wrote:
>>> Yes, one concern is that humans confuse the old and the new ID.
>>>
>>> I also think it makes sense to allow the new interfaces to look up the
>>> mount based on either the old or the new ID. But I could be wrong
>> Hm, mount id recycling may happen so quickly that for service restarts
>> with a lot of mounts this becomes mostly useless...
> Agreed. The old ID is mostly useful for human interaction.
>
>>> there, since that might encourage bad code. Maybe the new interface
>>> should only use take the new ID, which means no mixed use of
>>> /proc/$$/mountinfo and statmnt/listmnt.
>> ... so I think that is indeed the better way of doing things. There's no
>> need to encourage userspace to mix both identifiers.
> Okay.

I think having both is leaving more opportunity for confusion and the new

mount id has a different name so I think start the move to using that now

and only allow the new one for lookups.


>
> But I'd still leave the 2^32 offset for human confusion avoidance.

Yep, agreed.


Ian