tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: raid-on-raid during shutdown

der Mouse writes:
> I wrote
> > But if the top-level RAID _is_ mounted, the calls cascade as they
> > should.  I'm now trying to figure out why the lower-level RAIDs
> > _aren't_ ending up clean under _those_ circumstances.
> This appears to be spurious.  Now that I look carefully, I have been
> unable to produce a case where an upper-level RAID is mounted at
> shutdown time and the lower-level RAIDs don't end up clean.  I suspect
> all the cases I saw that made me think there was a problem were reboots
> without the upper-level RAIDs mounted.
> This leaves as the only problem that upper-level RAIDs which aren't
> mounted (or otherwise held open) at shutdown aren't getting torn down
> and thus aren't closing (which also means, aren't marking as clean)
> their underlying RAIDs.
> As a workaround, you can just mount (even with -r) a filesystem on each
> top-level RAID before bringing the machine down - ugly, but effective.
> Ideally, I'd say, RAID-on_RAID should push cleanness all the way down
> on close, so nothing needs to be done at shutdown, but I don't see any
> good way to do that, especially in view of stackings like
> RAID-on-cgd-on-RAID.
> I tried making raidframe register a shutdown hook which iterates over
> all extant units, attempting to tear down any which have openmask==0.
> This cures it for me.  I actually prefer this to the "tear down on last
> close during shutdown" code, though I haven't tried eliminating the
> latter and letting the shutdown hook do all the teardowns.

There are a couple of different things at play here:

 1) If a user unmounts a partition that is the last open partition, 
then we want to mark the RAID set as clean -- but we don't 
necessarily want to unconfigure the RAID set.

 2) If we're unconfiguring a RAID set, then there is still nothing 
that says we really should unconfigure any underlying RAID sets -- 
just because a RAID set is being unconfigured doesn't mean we're in 
the process of shutting down the system.

 3) If we *are* in the process of shutting down the system, then we 
want to have everything unstack itself and unconfigure/unmount/clean
each RAID set all the way through all devices.  But there is 
currently no mechanism for knowning this (at least, perhaps, no 
'nice' mechanism...)

Unfortunately, unless we have a flag that says "we're turning out the 
lights" there is no way for RAIDframe to know what operations to 
perform, other than only the specific operation that was requested 
(unmount, unconfigure, etc.).  And, as you've already identified, if 
there are other ccd or cgd or whatever devices intermixed, then it 
becomes even more of a mess in (currently) trying to figure out who 
should be unconfigured next... 


Greg Oster

Home | Main Index | Thread Index | Old Index