From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 lib/locking/locking.c lib/locking/locking ...
Date: 15 Nov 2007 21:30:53 -0000 [thread overview]
Message-ID: <20071115213053.26575.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2007-11-15 21:30:52
Modified files:
lib/locking : locking.c locking.h
tools : pvdisplay.c toollib.c vgreduce.c
Log message:
more vg_read lock fixes
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvdisplay.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.116&r2=1.117
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
--- LVM2/lib/locking/locking.c 2007/11/02 13:06:41 1.41
+++ LVM2/lib/locking/locking.c 2007/11/15 21:30:52 1.42
@@ -335,6 +335,11 @@
{
char resource[258] __attribute((aligned(8)));
+ if (flags == LCK_NONE) {
+ log_debug("Internal error: %s: LCK_NONE lock requested", vol);
+ return 1;
+ }
+
switch (flags & LCK_SCOPE_MASK) {
case LCK_VG:
/* Lock VG to change on-disk metadata. */
--- LVM2/lib/locking/locking.h 2007/11/15 02:55:22 1.36
+++ LVM2/lib/locking/locking.h 2007/11/15 21:30:52 1.37
@@ -86,7 +86,7 @@
/*
* Common combinations
*/
-#define LCK_NONE 0
+#define LCK_NONE (LCK_VG | LCK_NULL)
#define LCK_VG_READ (LCK_VG | LCK_READ | LCK_HOLD)
#define LCK_VG_WRITE (LCK_VG | LCK_WRITE | LCK_HOLD)
--- LVM2/tools/pvdisplay.c 2007/11/15 02:20:03 1.43
+++ LVM2/tools/pvdisplay.c 2007/11/15 21:30:52 1.44
@@ -31,6 +31,7 @@
if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,
LCK_VG_READ, CLUSTERED, 0))) {
log_error("Skipping volume group %s", vg_name);
+ /* FIXME If CLUSTERED should return ECMD_PROCESSED here */
return ECMD_FAILED;
}
--- LVM2/tools/toollib.c 2007/11/15 02:20:03 1.116
+++ LVM2/tools/toollib.c 2007/11/15 21:30:52 1.117
@@ -443,10 +443,9 @@
if (ret > ret_max)
ret_max = ret;
if (sigint_caught())
- return ret_max;
+ break;
}
-out:
if (vg_name)
unlock_vg(cmd, vg_name);
@@ -747,8 +746,15 @@
if (sigint_caught())
return ret_max;
}
- if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) &&
- !list_empty(vgnames)) {
+ if (vg) {
+ ret = process_each_pv_in_vg(cmd, vg, &tags,
+ handle, process_single);
+ if (ret > ret_max)
+ ret_max = ret;
+ if (sigint_caught())
+ return ret_max;
+ } else if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) &&
+ !list_empty(vgnames)) {
list_iterate_items(sll, vgnames) {
if (!lock_vol(cmd, sll->str, lock_type)) {
log_error("Can't lock %s: skipping", sll->str);
--- LVM2/tools/vgreduce.c 2007/11/14 18:41:05 1.70
+++ LVM2/tools/vgreduce.c 2007/11/15 21:30:52 1.71
@@ -539,7 +539,7 @@
/* FIXME: Pass private struct through to all these functions */
/* and update in batch here? */
- ret = process_each_pv(cmd, argc, argv, vg, LCK_VG_WRITE, NULL,
+ ret = process_each_pv(cmd, argc, argv, vg, LCK_NONE, NULL,
_vgreduce_single);
}
next reply other threads:[~2007-11-15 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 21:30 agk [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-07-15 5:49 LVM2 lib/locking/locking.c lib/locking/locking mornfall
2007-06-15 20:46 agk
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=20071115213053.26575.qmail@sourceware.org \
--to=agk@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.