From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 1/3] Return fail if lv_deactivate did not removed device from kernel.
Date: Thu, 17 Sep 2009 17:25:35 +0200 [thread overview]
Message-ID: <4AB254EF.2080008@redhat.com> (raw)
Return fail if lv_deactivate did not removed device from kernel.
lv_deactivate now returns always success, because tree deactivation
functions (see dm_tree_deactivate_children) always returns success.
Because code should return failure in lv_deactivate at least,
fix it by checking for device existence after real deactivation call.
(After discussion this was preferred solution to dm tree function rewrite
which affects snapshots and mirrors.)
Signed-off-by: Milan Broz <mbroz@redhat.com>
---
lib/activate/activate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index aa75e5b..724c1fe 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1017,6 +1017,8 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s)
memlock_dec();
fs_unlock();
+ if (!lv_info(cmd, lv, &info, 1, 0) || info.exists)
+ r = 0;
out:
if (lv)
vg_release(lv->vg);
next reply other threads:[~2009-09-17 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 15:25 Milan Broz [this message]
2009-09-28 19:32 ` [PATCH 1/3] Return fail if lv_deactivate did not removed device from kernel Alasdair G Kergon
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=4AB254EF.2080008@redhat.com \
--to=mbroz@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.