From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs-kernel/src/dlm lock_dlm.h plock.c
Date: 3 Dec 2007 16:40:42 -0000 [thread overview]
Message-ID: <20071203164042.20857.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: teigland at sourceware.org 2007-12-03 16:40:41
Modified files:
gfs-kernel/src/dlm: lock_dlm.h plock.c
Log message:
Posix locks don't work between threads, but it seems some programs do
involve threads sharing plocks incidentally (with meaningless results).
Given the plock state we keep in lock_dlm, multiple threads accessing the
locks would not only be meaningless, but could corrupt the state, leaving
the threads permanently hung. This patch tries to keep threads from
stomping on each other, hopefully preventing most hangs.
bz 383391
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/lock_dlm.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.18.2.7&r2=1.18.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/dlm/plock.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.12.2.4&r2=1.12.2.5
--- cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h 2007/03/22 21:23:18 1.18.2.7
+++ cluster/gfs-kernel/src/dlm/Attic/lock_dlm.h 2007/12/03 16:40:41 1.18.2.8
@@ -152,6 +152,7 @@
uint64_t end;
int count;
int ex;
+ int busy;
};
#define LFL_NOBLOCK 0
--- cluster/gfs-kernel/src/dlm/Attic/plock.c 2007/03/22 21:23:18 1.12.2.4
+++ cluster/gfs-kernel/src/dlm/Attic/plock.c 2007/12/03 16:40:41 1.12.2.5
@@ -488,8 +488,10 @@
if (found) {
DLM_ASSERT(po->lp, );
+ po->busy = 1;
error = wait_async(po->lp);
DLM_ASSERT(!error, );
+ po->busy = 0;
goto restart;
}
}
@@ -1154,8 +1156,15 @@
int found = FALSE;
list_for_each_entry(po, &r->locks, list) {
- if (po->owner == owner)
- continue;
+ if (po->owner == owner) {
+ if (!po->busy)
+ continue;
+ log_debug("po busy %llx %llu %u",
+ (unsigned long long)name->ln_number,
+ (unsigned long long)owner, po->pid);
+ found = TRUE;
+ break;
+ }
if (!ranges_overlap(po->start, po->end, *start, *end))
continue;
reply other threads:[~2007-12-03 16:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20071203164042.20857.qmail@sourceware.org \
--to=teigland@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).