Subject: Re: raidframe: parity dirty with read-only file systems?
To: Klaus Heinz <k.heinz.jul.sechs@onlinehome.de>
From: Greg Oster <oster@cs.usask.ca>
List: tech-kern
Date: 07/13/2006 09:51:50
Klaus Heinz writes:
> Hi,
> 
> due to some problems with external USB disks I had NetBSD/i386 3.0_stable
> crashing. In order to reproduce the problem without breaking my file
> systems I marked all of them read-only in /etc/fstab.
> 
> Every time after the crash happened the parity information of the raid
> with mounted (read-only) file systems was "dirty" while parity for the
> raid with unmounted file-systems was "clean".
> 
> I assume parity can only get "dirty" when data is written to the raid
> disks.
> How can anything be written to a raid when all the file-systems are
> read-only?

Well, nothing should be, but RAIDframe doesn't currently detect that 
it's just being opened read-only.  I just trolled through 
ffs_vfsops.c, and I can see where RAIDframe can be told that it's
a read-only mount (though VOP_OPEN), but I can't see where it would 
be told that the filesystem is transitioning from read-only to 
read-write.  Unless this information can get passed in through 
VOP_OPEN (or by some other means) and for all possible filesystems 
that might live on top of a RAID set, RAIDframe is stuck in thinking 
that whoever opened a partition might want to write to it... and 
thus it gets marked "dirty" as soon as it's opened, and doesn't get 
marked "clean" until the last open partition is closed.

Later...

Greg Oster