[lvm-devel] [PATCH] Cleanup partial failure of activation
Alasdair G Kergon
agk at redhat.com
Thu Nov 22 02:42:10 UTC 2007
On Wed, Nov 21, 2007 at 09:16:44PM -0500, Jun'ichi Nomura wrote:
> Currently, mirror, snapshot and pvmove are only stacking-type LVs.
> They don't allow partial activation.
> # Is this assumption correct?
>
> If the above is correct, the tree is either activated or deactivated
> as a whole. So, if activation failed, deactivating the LV would
> return it to the state before activation is called.
Have all the code paths been audited?
The general "self-correcting" philosophy throughout the activation code is to
ensure the LV is in a known final state when they return success, and to cope
with a broad range of initial states.
This patch would represent a change in the semantics of the functions,
reducing the range of initial states handled sensibly.
Look at the lv_resume code path, for example. Wouldn't it be more sensible to
revert to the previous table on failure than to attempt to remove the device?
I don't believe this problem can be resolved with such a tiny patch.
There are two approaches:
1) have proper reversion code inside the guts of the library activation code
2) let the caller, which possesses knowledge about the *sequence* of steps
making up the operation, handle reversion sensibly
I expect a mixture of the two - mostly (2) in the places we need it now (quick
and easy and a few cases already done), but eventually more use of (1) which is
technically a better solution (but harder).
Alasdair
--
agk at redhat.com
More information about the lvm-devel
mailing list