[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/52056: mount -u / causes a kernel assertion
The following reply was made to PR kern/52056; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: Matt Sporleder <msporleder%gmail.com@localhost>
Cc: =?utf-8?Q?Jarom=C3=ADr_Dole=C4=8Dek?= <jaromir.dolecek%gmail.com@localhost>,
Martin Husemann <martin%netbsd.org@localhost>
Subject: Re: kern/52056: mount -u / causes a kernel assertion
Date: Sat, 11 Mar 2017 08:00:54 +0700
Date: Fri, 10 Mar 2017 18:39:11 -0500
From: Matt Sporleder <msporleder%gmail.com@localhost>
| What do the other BSDs do in this case?
Back in 1999, FreeBSD appear to have removed the reference to getting
options from fstab before the command line from their man page - but at
the same time they added two new "pseudo-options" for use with -u,
those being "current" and "fstab".
In their system:
mount -u -o fstab <whatever-filesys>
would do what the NetBSD man page (and earlier FreeBSD man page)
said should happen.
Without -o current, I believe they set the mount options to exactly whatever
is set on the command line, with that option they add/subtract options
from what is currently set.
OpenBSD removed the reference to getting options from fstab with -u from
their man page on Dec 31, 2000 (just a couple of hours before the turn of
the millenium (UTC) - I guess they thought they should have a housecleaning...)
Unlike NetBSD (and FreeBSD when no -o current is given) they seem to
apply the options given with mount -u on top of the currently listed
options (though their man page does not say that) - ie: they do what
FreeBSD would write as:
mount -u -o current,others... <filesys>
just by saying
mount -u -o others... <filesys>
whereas we just set the options to whatever is given on the command line,
ingnoring whatever was set when the filesys was originally mount, or
last mount -u'd. (but note, that one of "ro" or "rw" is effectively
*always* given on the command line.)
I don't know how to check other BSD derived systems.
Given all that, the best might be to basically copy the FreeBSD setup,
though I think I would prefer if
mount -u <filesys>
with no command line options at all (which currently means mount rw,
and disable any other mount options previously set, on NetBSD and FreeBSD,
and would be a "convert to rw, leaving all other options on OpenBSD)
was instead treated as if (in FreeBSD syntax)
mount -u -o fstab <filesys>
was given, so this (just mount -u) becomes an easy way to simply set the
filesys mount to the way fstab says it should be.
I think I'd also like to remove the magic "one is always set" from the
-r/-w flags when used with -u, so it is more easily possible to add an
option without accidentally turning a ro mount into rw.
ps: apologies if I have misstated what FreeBSD or OpenBSD do, I looked
at their man pages, and briefly at their code - I did not run either to test.
Main Index |
Thread Index |