From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/modules/storage LVM.cpp
Date: 16 Jan 2007 17:05:28 -0000 [thread overview]
Message-ID: <20070116170528.5351.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2007-01-16 17:05:27
Modified files:
ricci/modules/storage: LVM.cpp
Log message:
Fix for 222223 (deactivate LV before removal)
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.10&r2=1.11
--- conga/ricci/modules/storage/LVM.cpp 2006/12/12 13:11:51 1.10
+++ conga/ricci/modules/storage/LVM.cpp 2007/01/16 17:05:27 1.11
@@ -589,8 +589,8 @@
LVM::lvremove(const String& path)
{
vector<String> args;
- args.push_back("lvremove");
- args.push_back("--force");
+ args.push_back("lvchange");
+ args.push_back("-an");
args.push_back(path);
String out, err;
@@ -598,8 +598,28 @@
if (utils::execute(LVM_BIN_PATH, args, out, err, status, false))
throw command_not_found_error_msg(LVM_BIN_PATH);
if (status != 0)
- throw String("lvremove failed");
- utils::clear_cache();
+ throw String("Unable to deactivate LV (might be in use by other cluster nodes)");
+
+ try {
+ args.clear();
+ args.push_back("lvremove");
+ args.push_back("--force");
+ args.push_back(path);
+
+ if (utils::execute(LVM_BIN_PATH, args, out, err, status, false))
+ throw command_not_found_error_msg(LVM_BIN_PATH);
+ if (status != 0)
+ throw String("lvremove failed");
+ utils::clear_cache();
+ } catch ( ... ) {
+ args.clear();
+ args.push_back("lvchange");
+ args.push_back("-ay");
+ args.push_back(path);
+ utils::execute(LVM_BIN_PATH, args, out, err, status, false);
+ utils::clear_cache();
+ throw;
+ }
}
void
next reply other threads:[~2007-01-16 17:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-16 17:05 kupcevic [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-01-17 14:41 [Cluster-devel] conga/ricci/modules/storage LVM.cpp kupcevic
2006-11-29 16:39 rmccabe
2006-11-01 21:27 kupcevic
2006-08-21 15:44 kupcevic
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=20070116170528.5351.qmail@sourceware.org \
--to=kupcevic@sourceware.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).