All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alasdair G Kergon <agk@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Cleanup partial failure of activation
Date: Thu, 22 Nov 2007 02:42:10 +0000	[thread overview]
Message-ID: <20071122024210.GS22843@agk.fab.redhat.com> (raw)
In-Reply-To: <4744E68C.3050601@ce.jp.nec.com>

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



  reply	other threads:[~2007-11-22  2:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 16:00 [PATCH] Cleanup partial failure of activation Jun'ichi Nomura
2007-11-21 22:42 ` Alasdair G Kergon
2007-11-22  2:16   ` Jun'ichi Nomura
2007-11-22  2:42     ` Alasdair G Kergon [this message]
2007-11-27  1:51       ` Jun'ichi Nomura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071122024210.GS22843@agk.fab.redhat.com \
    --to=agk@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.