Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Apr 2005 17:12:08 +1000
From:      Peter Jeremy <PeterJeremy@optushome.com.au>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: Panic on mount with write-locked USB media (umass)
Message-ID:  <20050406071208.GA87505@cirb503493.alcatel.com.au>
In-Reply-To: <2871.1112734748@critter.freebsd.dk>
References:  <20050405201820.042685D07@ptavv.es.net> <2871.1112734748@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 2005-Apr-05 22:59:08 +0200, Poul-Henning Kamp wrote:
>There are two ways that a filesystem correctly could handle a R/O
>media:
>
>1.	Fail with EROFS unless asked t mouned read-only

Note that EROFS is not a documented return code for [n]mount(2).
This is probably a bug.

>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.

I agree that [n]mount(2) should fail with EROFS.  There are benefits
in having mount(8) detect this case and retry the mount - it makes
mount(8) more intuitive for interactive use.

It's a pity there isn't provision for a "partially successful" exit
code - then mount(8) could both perform a read-only mount and any
scripts could check that they got the mount they expected.

Peter



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