Subject: bug#51425: file-system: validate flags

From: Tobias Geerinckx-Rice <[email-masked]>
Date: Sat, 30 Oct 2021 02:48:50 +0200

Maxim,

Maxim Cournoyer 写道：
> Another thing that is tricky about options is that some of them 
> are only
> really understood by the 'mount' command line utility, not the 
> 'mount'
> system call such as used in our init RAM disk (both are thrown 
> together
> in 'man 8 mount' without an easy way to discern them apart, 
> IIRC).

Aha!  Let me introduce you to the only slightly unfortunately 
named ‘man 2 mount’ instead.

The way mount(8) lumps both together is… I guess it's 
user-friendly — in a way? — but it leads to this total confusion 
about what's what.  Think of flags as literal bit flags, mainly 
because they are.

Guix does make the distinction.  It's the right call but it leads 
to a brief education moment the first time you encounter both 
fields.

You're absolutely right that mount options OTOH are arbitrary 
strings.  They can't and shouldn't be ‘validated’, but we don't 
currently mandate their stringiness, and should.

Kind regards,

T G-R