From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 8 12:20:23 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E78DE1065673; Fri, 8 Apr 2011 12:20:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 83EBE8FC12; Fri, 8 Apr 2011 12:20:23 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p38CKJ8w026370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Apr 2011 22:20:20 +1000 Date: Fri, 8 Apr 2011 22:20:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4D9EF55C.5070300@FreeBSD.org> Message-ID: <20110408214920.I1265@besplex.bde.org> References: <4D9DF375.4080506@FreeBSD.org> <20110408000025.GA16252@icarus.home.lan> <4D9EF55C.5070300@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Fri, 08 Apr 2011 12:24:45 +0000 Cc: Garrett Cooper , freebsd-fs@freebsd.org, Jeremy Chadwick , FreeBSD Hackers Subject: Re: retry mounting with ro when rw fails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 12:20:24 -0000 On Fri, 8 Apr 2011, Andriy Gapon wrote: > on 08/04/2011 03:00 Jeremy Chadwick said the following: >> On Thu, Apr 07, 2011 at 01:20:53PM -0700, Garrett Cooper wrote: >>> As a generic question / observation, maybe we should just >>> implement 'errors=remount-ro' (or a reasonable facsimile) like Linux >>> has in our mount(8) command? Doesn't look like NetBSD, OpenBSD, or >>> [Open]Solaris sported similar functionality. >> >> I was going to recommend exactly this. :-) >> >> I like the idea of Andriy's patch, but would feel more comfortable if it >> were only used if a mount option was specified (-o errors=remount-ro"). > > Having the option is appealing, but my main motivation was the simplicity that > comes from having that enabled by default. > That is, you absolutely want an R/W mount then use -o rw, you need R/O then > explicitly -o ro, you "just want" to get that media mounted then the default > behavior tries its best. But the default behaviour is backwards, especially for read-mostly removable media. The default should be ro, possibly with an automagic upgrade to rw iff the media really needs to be written too. Writing timestamps for file system and inode access times doesn't count as "really needs to be written to". I think I prefer requiring an explicit upgrade to rw. rw implies writing access times unless you also use noatime, and I wouldn't want noatime to be set automagically depending on whether rw is set explicitly, so I would want noatime to be set explicitly, and once you do that then you can easily set rw or ro at the same time. A new rm (read mostly) or "rwa" (read or write automagically) flag could give automatic upgrade from ro to rw. I'd also like automatic downgrade to ro after a file system has not been written to for some time (this would avoid fscks in most cases for read-mostly file systems. The ro flag should be per-cylinder-group in ffs so that on big disks, most parts are read-only most of the time and don't need to be checked). Bruce