From: Patrick Caulfield <pcaulfie@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] get exclusive lock on an LV before removing it.
Date: Mon, 23 Oct 2006 11:11:44 +0100 [thread overview]
Message-ID: <453C9560.8040701@redhat.com> (raw)
This patch is for BZ#209370 and prevents removing of an LV that is activated exclusively on another node.
patrick
Index: tools/lvremove.c
===================================================================
RCS file: /cvs/lvm2/LVM2/tools/lvremove.c,v
retrieving revision 1.48
diff -u -p -r1.48 lvremove.c
--- tools/lvremove.c 9 May 2006 21:23:51 -0000 1.48
+++ tools/lvremove.c 23 Oct 2006 10:10:48 -0000
@@ -75,6 +75,16 @@ static int lvremove_single(struct cmd_co
if (!archive(vg))
return ECMD_FAILED;
+ /* If the VG is clustered then make sure no-one else is using the LV
+ we are about to remove */
+ if (vg->status & CLUSTERED) {
+ if (!activate_lv_excl(cmd, lv)) {
+ log_error("Can't get exclusive access to volume \"%s\"",
+ lv->name);
+ return ECMD_FAILED;
+ }
+ }
+
/* FIXME Snapshot commit out of sequence if it fails after here? */
if (!deactivate_lv(cmd, lv)) {
log_error("Unable to deactivate logical volume \"%s\"",
--
patrick
reply other threads:[~2006-10-23 10:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=453C9560.8040701@redhat.com \
--to=pcaulfie@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.