* [PATCH] get exclusive lock on an LV before removing it.
@ 2006-10-23 10:11 Patrick Caulfield
0 siblings, 0 replies; only message in thread
From: Patrick Caulfield @ 2006-10-23 10:11 UTC (permalink / raw)
To: lvm-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-10-23 10:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 10:11 [PATCH] get exclusive lock on an LV before removing it Patrick Caulfield
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.