Subject: Re: FFS journal
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Date: 07/04/2006 15:32:36
>>> This one could be solved by deleting the file on disk when the
>>> filesystem is made read-only, I think.
>> That will [...] not, however, preserve the long-standing Unix
>> semantics of continuing to use open-but-unlinked files.
> Why couldn't the file continue to be used, even if it is deleted on
> disk? Remember, the filesystem is now RO, so nothing can reuse the
> freed data and metadata for another purpose.
This depends on the filesystem, of course.
For FFS, I think this would work: the inode is cleared, but the inode
is locked in core anyway while the file is open - and the data and
indirect blocks will be marked free but, as you say, their contents
will be undisturbed.
I don't know other filesystems enough to speak to them.
However, even for FFS, it will break if you switch from RW to RO and
then back to RW.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML email@example.com
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B