Date: Tue, 22 Feb 2000 23:46:45 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Alfred Perlstein <alfred@FreeBSD.org> Cc: Luoqi Chen <luoqi@watermarkgroup.com>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sbin/mount mount.8 Message-ID: <Pine.BSF.4.21.0002222321180.2368-100000@alphplex.bde.org> In-Reply-To: <20000221204548.Z21720@fw.wintelcom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 21 Feb 2000, Alfred Perlstein wrote:
> * Luoqi Chen <luoqi@watermarkgroup.com> [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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0002222321180.2368-100000>
