From: mornfall@sourceware.org <mornfall@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 daemons/dmeventd/plugins/mirror/dmeventd_ ...
Date: 15 Jun 2009 14:47:40 -0000 [thread overview]
Message-ID: <20090615144740.4472.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mornfall at sourceware.org 2009-06-15 14:47:40
Modified files:
daemons/dmeventd/plugins/mirror: dmeventd_mirror.c
tools : lvconvert.c vgreduce.c
Log message:
- Ignore suspended devices during repair (Milan).
- Call vgreduce --removemissing (without --force) automatically to clean up bad
PVs (Milan).
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.81&r2=1.82
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92
--- LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c 2009/06/04 12:01:15 1.23
+++ LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c 2009/06/15 14:47:39 1.24
@@ -161,6 +161,12 @@
r = lvm2_run(_lvm_handle, cmd_str);
+ if (r == 1) {
+ snprintf(cmd_str, CMD_SIZE, "vgreduce --removemissing %s", vg);
+ if (lvm2_run(_lvm_handle, cmd_str) != 1)
+ syslog(LOG_ERR, "Unable to remove failed PVs from VG %s", vg);
+ }
+
dm_pool_empty(_mem_pool); /* FIXME: not safe with multiple threads */
return (r == 1) ? 0 : -1;
}
--- LVM2/tools/lvconvert.c 2009/06/15 13:43:16 1.81
+++ LVM2/tools/lvconvert.c 2009/06/15 14:47:39 1.82
@@ -926,18 +926,22 @@
struct lvconvert_params lp;
int ret = ECMD_FAILED;
struct lvinfo info;
+ int saved_ignore_suspended_devices = ignore_suspended_devices();
if (!_read_params(&lp, cmd, argc, argv)) {
stack;
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, repair_ARG))
+ init_ignore_suspended_devices(1);
+
log_verbose("Checking for existing volume group \"%s\"", lp.vg_name);
if (!(vg = vg_lock_and_read(cmd, lp.vg_name, NULL, LCK_VG_WRITE,
CLUSTERED | EXPORTED_VG | LVM_WRITE,
CORRECT_INCONSISTENT)))
- return ECMD_FAILED;
+ goto out;
if (!(lvl = find_lv_in_vg(vg, lp.lv_name))) {
log_error("Logical volume \"%s\" not found in "
@@ -966,6 +970,7 @@
lp.wait_completion ? 0 : 1U);
}
out:
+ init_ignore_suspended_devices(saved_ignore_suspended_devices);
vg_release(vg);
return ret;
}
--- LVM2/tools/vgreduce.c 2009/05/21 03:04:54 1.91
+++ LVM2/tools/vgreduce.c 2009/06/15 14:47:40 1.92
@@ -466,6 +466,7 @@
int consistent = 1;
int fixed = 1;
int repairing = arg_count(cmd, removemissing_ARG);
+ int saved_ignore_suspended_devices = ignore_suspended_devices();
if (!argc && !repairing) {
log_error("Please give volume group name and "
@@ -515,6 +516,9 @@
return ECMD_FAILED;
}
+ if (repairing)
+ init_ignore_suspended_devices(1);
+
if ((!(vg = vg_read_internal(cmd, vg_name, NULL, &consistent)) || !consistent)
&& !repairing) {
log_error("Volume group \"%s\" doesn't exist", vg_name);
@@ -574,6 +578,7 @@
}
out:
+ init_ignore_suspended_devices(saved_ignore_suspended_devices);
unlock_and_release_vg(cmd, vg, vg_name);
return ret;
next reply other threads:[~2009-06-15 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-15 14:47 mornfall [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-08 11:29 LVM2 daemons/dmeventd/plugins/mirror/dmeventd_ zkabelac
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=20090615144740.4472.qmail@sourceware.org \
--to=mornfall@sourceware.org \
--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.