Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Apr 2005 09:33:03 -0700
From:      "Kevin Oberman" <oberman@es.net>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: Panic on mount with write-locked USB media (umass) 
Message-ID:  <20050406163303.3AD345D08@ptavv.es.net>
In-Reply-To: Your message of "Tue, 05 Apr 2005 23:55:27 BST." <20050405235414.D81173@fledge.watson.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Tue, 5 Apr 2005 23:55:27 +0100 (BST)
> From: Robert Watson <rwatson@FreeBSD.org>
> 
> On Tue, 5 Apr 2005, Poul-Henning Kamp wrote:
> 
> > In message <20050405201820.042685D07@ptavv.es.net>, "Kevin Oberman" writes:
> >
> >>> It would be useful if mount was smart enough to notice when it is
> >>> dealing with a read-only device, and try to mount such things
> >>> read-only, rather than trying to mount things read-write by default and
> >>> failing.  Of course, the system shouldn't panic, either.  :-)
> >>
> >> I think that is what I said. I am almost sure that this is how it used
> >> to work. I'm not sure whether the change was caused by something in
> >> msdosfs or GEOM (or somewhere else), but I sure preferred it when the RO
> >> device mounted RO. CDs still do this (thankfully). This makes me suspect
> >> msdosfs is the culprit.
> >
> > There are two ways that a filesystem correctly could handle a R/O media:
> >
> > 1.	Fail with EROFS unless asked t mouned read-only
> >
> > 2.	Silently downgrade th emount to read-only.
> >
> > I personally prefer the first because that way a script does not have to 
> > check if it got the mount it wanted or not.
> 
> In general, I agree, but this will de-POLA the following command:
> 
>      mount -t cd9660 /dev/acd0 /cdrom
> 
> I wonder if a useful middle ground is to adopt (1) above except in the 
> case of perenially read-only file systems (cd9660), in which case (2) is 
> adopted?

I hate to see such inconsistency. I don't like seeing very similar
devices behaving differently for no good reason.

I think a better idea is a new option to allow/reject demotion to
read-only when hardware does not allow writes. POLA is slight and it
lets people do what they want to do with the issue.

Because of the existence of "mount -t cd9660 /dev/acd0 /cdrom", I think
that default should be to demote.
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050406163303.3AD345D08>