From owner-freebsd-current@FreeBSD.ORG Wed Apr 6 07:12:12 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55BC416A4CE for ; Wed, 6 Apr 2005 07:12:12 +0000 (GMT) Received: from mail24.syd.optusnet.com.au (mail24.syd.optusnet.com.au [211.29.133.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC1B343D2F for ; Wed, 6 Apr 2005 07:12:11 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j367C9wA013135 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 6 Apr 2005 17:12:10 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j367C97l087574; Wed, 6 Apr 2005 17:12:09 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j367C99h087573; Wed, 6 Apr 2005 17:12:09 +1000 (EST) (envelope-from pjeremy) Date: Wed, 6 Apr 2005 17:12:08 +1000 From: Peter Jeremy To: Poul-Henning Kamp Message-ID: <20050406071208.GA87505@cirb503493.alcatel.com.au> References: <20050405201820.042685D07@ptavv.es.net> <2871.1112734748@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2871.1112734748@critter.freebsd.dk> User-Agent: Mutt/1.4.2i cc: current@freebsd.org Subject: Re: Panic on mount with write-locked USB media (umass) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2005 07:12:12 -0000 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