All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] (11/11) re-instantiate automatic VG recovery
Date: Sun, 23 Nov 2008 22:55:17 -0500	[thread overview]
Message-ID: <1227498917.6608.14.camel@localhost.localdomain> (raw)
In-Reply-To: <87fxme2amo.fsf@eriador.mornfall.net>


On Thu, 2008-10-30 at 19:36 +0100, Petr Rockai wrote:
> +static vg_t *_recover_vg(struct cmd_context *cmd, const char *lock,
> const char *vg_name,
> +                        const char *vgid, uint32_t lock_flags )
> +{
> +       int consistent = 1;
> +       struct volume_group *vg;
> +
> +       lock_flags &= ~LCK_TYPE_MASK;
> +       lock_flags |= LCK_WRITE;
> +
> +       unlock_vg(cmd, lock);
> +       if (!lock_vol(cmd, lock, lock_flags))
> +               return_NULL;
> +
> +       if (!(vg = vg_read_internal(cmd, vg_name, vgid, &consistent)))
> +               return_NULL;
> +       if (!consistent)
> +               return_NULL;
> +       return vg;
> +}
> +
>  /*

A couple things:
1) Is there a reason you dropped the "if (lockingfailed()) return NULL"
from your version?  The original recover_vg() in toollib had this:
struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
				uint32_t lock_type)
{
	int consistent = 1;

	/* Don't attempt automatic recovery without proper locking */
	if (lockingfailed())
		return NULL;

	lock_type &= ~LCK_TYPE_MASK;
	lock_type |= LCK_WRITE;

2) Note that in some of the original paths (e.g. vgconvert) that called
recover_vg(), there was a call to "dev_close_all()", while others did
not (e.g. process_each_lv()).

3) Previous to this, in the case of inconsistent metadata, we sometimes
would do recovery while others we would not.  Now we're doing recovery
in all cases?  Is this what we want, especially with the reporting
tools?





  reply	other threads:[~2008-11-24  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 18:36 [PATCH] (11/11) re-instantiate automatic VG recovery Petr Rockai
2008-11-24  3:55 ` Dave Wysochanski [this message]
2008-11-24 15:19   ` Petr Rockai

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=1227498917.6608.14.camel@localhost.localdomain \
    --to=dwysocha@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.