tech-kern archive

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

Re: raid-on-raid during shutdown



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.

I can provide a diff between 4.0.1 stock and my current raidframe, but
that will be only mildly useful, since it also includes other patches:
my backporting of stacked-RAID autoconfigure, the fixes for progress
indicators going wonky because of overflow when multiplying by 100, a
crash fix when unconfiguring a raid that's doing parity recomputation,
and a crash fix when reconstructing too big a unit.  And the shutdown
hook code needs attention; I haven't bothered KNF-uglifying it, in part
because it's likely I've done something more seriously wrong, though it
seems to work for me.  But if anyone wants a copy anyway, I'll
certainly be happy to provide the modified files, diffs from stock
4.0.1, a copy of my whole sys/dev/raidframe, whatever.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index