Re: Journaling: Surviving or allowing unclean shutdown?

Andreas Dilger
2001-01-05T08:11:08Z

Stefan, you write:
> [Re: read-only filesystem vs. read-only device]
> Anyway, it is "especially" critical on the root filesystem because the
> authors of filesystems can't support two ro states on boot.
>
> Reiserfs allowed -oro,noreplay.
>
> Please tell me how to specify "noreplay" for the initial "/" mount :)

Actually, for ext3 Stephen added a kernel option "rootflags" so that you
can pass mount options to the root filesystem. This was previously needed
to add a journal to an existing ext2 root filesystem. I hope he keeps it
around anyways, and submits it as a regular kernel patch, because it is
useful for many other things.

> But this has nothing to do with forcing a write on "ro" mounts, which
> I interpret as design bug. (ro,noreplay is also a kind of design bug,
> everything except a virtual replay under physical ro conditions looks
> like a design bug to me because it breaks user expectations either
> by writing on "ro" or by giving an invalid view by "noreplay")

If the VM subsystem can tolerate keeping dirty pages around for a read-only
device then virtual replay can be made to work, for no more memory than
might be pinned by having a journal in the first place. The only problem
is that normal journal pages will eventually be freed, whereas virtual
journal replay pages would not (until the filesystem is unmounted or mounted
read-write). This _may_ be OK in some cases, but I think most people with
journalled filesystem have more journal space than RAM, so you will likely
get into bad situations very quickly, all for a technical nit.

Currently ext3 just refuses to load on a read-only device if the journal
is dirty. However, changes are upcoming to allow LVM snapshots on ext3
filesystems, so there is little legitimate need for a dirty journal on
a read-only device.

Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert