On Sat, Jul 09, 2016 at 06:20:49PM +0300, Vadim Zhukov wrote:
> Hello all.
> 

evening.

> As found by some of my students, mount(2) lacks description of some
> flags used by userland. After trying to sync things out, I realized
> that this page is not well organized at all. For example, unmount
> syscall is mentioned closer to end, after description of flags that
> it could use.
> 
> I didn't document all of the flags involved in mount calls, since
> some of them are purely kernel internal. But I could easily miss
> something crucial...
> 
> So this is my first public draft of mount(2) patch. Looking for
> comments & thanks in advance!
> 
> --
> WBR,
>   Vadim Zhukov
> 

comments inline.

> 
> Index: mount.2
> ===================================================================
> RCS file: /cvs/src/lib/libc/sys/mount.2,v
> retrieving revision 1.46
> diff -u -p -r1.46 mount.2
> --- mount.2   27 May 2016 19:45:04 -0000      1.46
> +++ mount.2   9 Jul 2016 15:16:29 -0000
> @@ -70,31 +70,57 @@ at the time
>  of a successful mount are swept under the carpet, so to speak, and
>  are unavailable until the filesystem is unmounted.
>  .Pp
> +The
> +.Fn unmount
> +function call disassociates the filesystem from the specified
> +mount point
> +.Fa dir .
> +.Pp

i agree this is an improvement.

>  The following
>  .Fa flags
>  may be specified to
>  suppress default semantics which affect filesystem access.

note the sentence above. it makes adding some of these options tricky
since it will essentially contradict what is written there. so, assuming
there is a reason to document these other flags (that is, no reason not
to), you will have to change that sentence.

>  .Bl -tag -width MNT_SYNCHRONOUS
> -.It Dv MNT_RDONLY
> -The filesystem should be treated as read-only:
> -even the superuser may not write to it.
> +.It Dv MNT_ASYNC
> +All I/O to the filesystem should be done asynchronously.

ordering these alphabetically seems reasonable - i assume there's no
reason for the current order?

> +.It Dv MNT_FORCE
> +On unmount, specifies that the filesystem should be forcibly unmounted
> +even if files are still active.
> +Active special devices continue to work,
> +but any further accesses to any other active files result in errors

s/accesses/access/

> +even if the filesystem is later remounted.
> +On update, allows to forcibly change from read-write to read-only,

s/allows to forcibly change/forcibly changes/

> +even if there are files open for writing.
>  .It Dv MNT_NOATIME
>  Do not update the access time on files in the filesystem unless
>  the modification or status change times are also being updated.
> +.It Dv MNT_NODEV
> +Do not interpret special files on the filesystem.
>  .It Dv MNT_NOEXEC
>  Do not allow files to be executed from the filesystem.
>  .It Dv MNT_NOSUID
>  Do not honor setuid or setgid bits on files when executing them.
> -.It Dv MNT_NODEV
> -Do not interpret special files on the filesystem.
> -.It Dv MNT_SYNCHRONOUS
> -All I/O to the filesystem should be done synchronously.
> -.It Dv MNT_ASYNC
> -All I/O to the filesystem should be done asynchronously.
> +.It Dv MNT_RDONLY
> +The filesystem should be treated as read-only:
> +even the superuser may not write to it.
> +.It Dv MNT_RELOAD
> +Reload already mounted filesystem.

i think "reload" is a bit ambiguous. what does it actually do?

> +Used, e.g., by

i'd change the e.g. to "for example". or at least kill the comma after
the "g."

> +.Xr fsck 8 .
>  .It Dv MNT_SOFTDEP
>  Use soft dependencies.
>  Applies to FFS filesystems only (see 'softdep' in
>  .Xr mount 8 ) .
> +.It Dv MNT_SYNCHRONOUS
> +All I/O to the filesystem should be done synchronously.
> +.It Dv MNT_UPDATE
> +Indicates that the mount command is being applied to an already mounted
> +filesystem.
> +This allows the mount flags to be changed without requiring
> +that the filesystem be unmounted and remounted.
> +Some filesystems may not allow all flags to be changed.
> +For example,
> +most filesystems will not allow a change from read-write to read-only.
>  .It MNT_WXALLOWED
>  Processes that ask for memory to be made writeable plus executable
>  using the
> @@ -108,16 +134,6 @@ The option is typically used on the
>  filesystem.
>  .El
>  .Pp
> -The flag
> -.Dv MNT_UPDATE
> -indicates that the mount command is being applied
> -to an already mounted filesystem.
> -This allows the mount flags to be changed without requiring
> -that the filesystem be unmounted and remounted.
> -Some filesystems may not allow all flags to be changed.
> -For example,
> -most filesystems will not allow a change from read-write to read-only.
> -.Pp

i'm less sure here. i think this option makes sense outwith the option
list. but i guess if you change the first sentence, it might work. not
convinced, though.

>  The
>  .Fa type
>  argument defines the type of the filesystem.
> @@ -237,22 +253,6 @@ struct udf_args {
>       char    *fspec; /* block special device to mount */
>  };
>  .Ed
> -.Pp
> -The
> -.Fn unmount
> -function call disassociates the filesystem from the specified
> -mount point
> -.Fa dir .
> -.Pp
> -The
> -.Fa flags
> -argument may specify
> -.Dv MNT_FORCE
> -to specify that the filesystem should be forcibly unmounted even if files are
> -still active.
> -Active special devices continue to work,
> -but any further accesses to any other active files result in errors
> -even if the filesystem is later remounted.

similarly here.

>  .Sh RETURN VALUES
>  .Rv -std
>  .Sh ERRORS
> 

jmc

Reply via email to