From owner-cvs-all Tue Feb 22 4:46:59 2000 Delivered-To: cvs-all@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id BF6A837B67D for ; Tue, 22 Feb 2000 04:46:52 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (qmail 10838 invoked from network); 22 Feb 2000 12:46:48 -0000 Received: from bde.zeta.org.au (203.2.228.102) by gidora.zeta.org.au with SMTP; 22 Feb 2000 12:46:48 -0000 Date: Tue, 22 Feb 2000 23:46:45 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Alfred Perlstein Cc: Luoqi Chen , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sbin/mount mount.8 In-Reply-To: <20000221204548.Z21720@fw.wintelcom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Mon, 21 Feb 2000, Alfred Perlstein wrote: > * Luoqi Chen [000221 20:33] wrote: > > The danger of corruption when downgrading a rw mount to ro mount is real. > > I had a correspondence with kirk regarding one possible of scenario quite > > a while ago, but it was too nasty to fix (IIRC), so we dropped the issue. > > Do you have this archived anywhere, or can you explain what goes wrong? One problem (explained to me by Luoqi) is for unlinked open files. Consider the following sequence of events: (1) mount -o rw ... (2) fd = open("foo", O_WRONLY ...); (3) unlink("foo"); (4) mount -u -o ro ... -> vflush(...); (5) close(fd); -> ufs_inactive(...); Step (3) doesn't remove the inode because the file is open. Step (5) can't remove the inode because the filesystem is read-only. Step (4) apparently doesn't handle this problem (except possibly in the FORCECLOSE case). I added a similar but relatively harmless bug in the special-file timestamp optimisations. Writing of timestamps is delayed until ufs_inactive(), but that is too late if the filesystem has become read-only. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message