From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Do not count VG_GLOBAL to lock_count.
Date: Fri, 10 Jul 2009 16:10:40 +0200 [thread overview]
Message-ID: <4A574BE0.70704@redhat.com> (raw)
Do not count VG_GLOBAL to lock_count.
Otherwise all read-only scanning will open devices RW.
because of
flags = vg_write_lock_held() ? O_RDWR : O_RDONLY;
(And trigger udev rule because of IN_CLOSE_WRITE monitoring).
Anyway, there are many other situations when lvm opens
device RW unnecessarily...
Signed-off-by: Milan Broz <mbroz@redhat.com>
---
lib/locking/locking.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index 5c04b4f..482cdf0 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -189,12 +189,16 @@ void reset_locking(void)
_unblock_signals();
}
-static void _update_vg_lock_count(uint32_t flags)
+static void _update_vg_lock_count(const char *resource, uint32_t flags)
{
if ((flags & LCK_SCOPE_MASK) != LCK_VG ||
(flags & LCK_CACHE))
return;
+ /* Ignore global locks */
+ if (!strcmp(resource, VG_GLOBAL))
+ return;
+
if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
_vg_lock_count--;
else
@@ -356,7 +360,7 @@ static int _lock_vol(struct cmd_context *cmd, const char *resource, uint32_t fla
== LCK_READ);
}
- _update_vg_lock_count(flags);
+ _update_vg_lock_count(resource, flags);
}
_unlock_memory(flags);
next reply other threads:[~2009-07-10 14:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 14:10 Milan Broz [this message]
2009-07-10 16:09 ` [PATCH] Do not count VG_GLOBAL to lock_count Dave Wysochanski
2009-07-13 15:42 ` Milan Broz
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=4A574BE0.70704@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.