Subject: Re: how to bring a mounted filesystem to an almost clean state?
To: Christian Limpach <firstname.lastname@example.org>
From: Frank van der Linden <email@example.com>
Date: 02/25/2003 16:48:12
On Tue, Feb 25, 2003 at 04:37:22PM +0100, Christian Limpach wrote:
> do you think it would be (easily) possible to get the buf's which are flushed
> by VFS_SYNC somehow tagged? I've now tried to block all writes which don't
> have B_VFLUSH set but this doesn't quite work since VFS_SYNC blocks (I
> haven't identified which of its writes don't have B_VFLUSH set). When I
> release the block, VFS_SYNC finishes, the block is put back and the snapshot
> is taken. The window for 'new' writes to get through is apparently small
> enough that the few tests I've run created only fsck-clean snapshots. Does
> this make sense? How reasonable is this?
Hmm.. this could work, but there are some issues. First, you have to
identify all writes that need to be done. Then you mark them, and
off you go. However, sometimes (like when you have ffs+softdep),
buffers may be marked dirty after they were marked clean, because
they need to be written to get clean metadata state. You'd have
to catch that as well. Of course, the idea is that softdep always
has consistent metadata state, but, you simply don't know what
the filesystem using your device is doing, so you can't rely on
any of that.
Also, plain data writes via VOP_PUTPAGES use temporary buffers structures,
not part of the old buffer cache.
The idea of flagging buffers is a good one, but my first impression
is that you might still need support elsewhere in the code.