All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH]: Mirror: warn when activating mirror and !ignore_lvm_mirrors
Date: Tue, 22 Oct 2013 18:41:58 -0500	[thread overview]
Message-ID: <1382485318.19061.6.camel@f16> (raw)
In-Reply-To: <1382394852.4860.4.camel@f16>

Not sure if I care for the static variable, but I don't want it printed
for every mirror on every command that activates...

 brassow


Mirror: Print warning on activation if mirrors exists and !ignore_lvm_mirrors

Print a warning if mirrors are present and config file settings indicate
that they can be scanned for labels.  (A process that has the potential
to block indefinitely if it happens just after a failure.)

Index: lvm2/lib/activate/activate.c
===================================================================
--- lvm2.orig/lib/activate/activate.c
+++ lvm2/lib/activate/activate.c
@@ -1077,9 +1077,18 @@ static int _lv_open_count(struct cmd_con
 
 static int _lv_activate_lv(struct logical_volume *lv, struct lv_activate_opts *laopts)
 {
+	static int mirror_warning_printed = 0;
 	int r;
 	struct dev_manager *dm;
 
+	if (lv_is_mirrored(lv) && !lv_is_raid(lv) &&
+	    !mirror_warning_printed && !ignore_lvm_mirrors()) {
+		log_print("Scanning mirrors for LVM labels is enabled.\n"
+			  "  It is possible for this to cause I/O hangs and stuck LVM processes.\n"
+			  "  See 'ignore_lvm_mirrors' in the LVM configuation file for details.");
+		mirror_warning_printed = 1;
+	}
+
 	if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, (lv->status & PVMOVE) ? 0 : 1)))
 		return_0;
 




  parent reply	other threads:[~2013-10-22 23:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 22:34 [PATCH]: Mirror: Fix hangs and lock-ups caused by attempting label reads of mirrors Jonathan Brassow
2013-10-22  9:42 ` Zdenek Kabelac
2013-10-22 13:00   ` Brassow Jonathan
2013-10-22 23:39 ` [PATCH v2]: " Jonathan Brassow
2013-10-23  8:50   ` Zdenek Kabelac
2013-10-22 23:41 ` Jonathan Brassow [this message]
2013-10-23  7:52   ` [PATCH]: Mirror: warn when activating mirror and !ignore_lvm_mirrors Zdenek Kabelac

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=1382485318.19061.6.camel@f16 \
    --to=jbrassow@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.