Skip to contentSkip to conversation

dlm: Fix spin lock already unlocked bug

PATCH New Patrick Caulfield 3 participants 4 messages Jan 2, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm: Fix spin lock already unlocked bug

From the "how the hell did that get in there" collection.

I just noticed this message when testing some other changes I'd made to lowcomms (to use workqueues) but the problem seems to be in the current git trees too. I'm amazed no-one has seen it.

   BUG: spinlock already unlocked on CPU#1, dlm_recoverd/16868

Please check this before committing it someone (everyone?), in case I'm hallucinating after all the christmas punch ;-)

lowcomms-tcp.c.new renamed from lowcomms-tcp.c +2 -0
@@ -709,6 +709,7 @@
 	if (!con)
 		return NULL;
 
+	spin_lock(&con->writequeue_lock);
 	e = list_entry(con->writequeue.prev, struct writequeue_entry, list);
 	if ((&e->list == &con->writequeue) ||
 	    (PAGE_CACHE_SIZE - e->end < len)) {
@@ -747,6 +748,7 @@
 	struct connection *con = e->con;
 	int users;
 
+	spin_lock(&con->writequeue_lock);
 	users = --e->users;
 	if (users)
 		goto out;
#1 lore raw

PATCH 1/1 dlm: Fix spin lock already unlocked bug

Quoted 25 lines · Patrick Caulfield
Quoted 1 line

From the "how the hell did that get in there" collection.

I just noticed this message when testing some other changes I'd made to lowcomms (to use workqueues) but the problem seems to be in the current git trees too. I'm amazed no-one has seen it.

   BUG: spinlock already unlocked on CPU#1, dlm_recoverd/16868

Please check this before committing it someone (everyone?), in case I'm hallucinating after all the christmas punch ;-)

lowcomms-tcp.c.new renamed from lowcomms-tcp.c +1 -0
@@ -709,6 +709,7 @@
 	if (!con)
 		return NULL;
 
+	spin_lock(&con->writequeue_lock);
 	e = list_entry(con->writequeue.prev, struct writequeue_entry, list);
 	if ((&e->list == &con->writequeue) ||
 	    (PAGE_CACHE_SIZE - e->end < len)) {

lowcomms-tcp.c.new line 754

Quoted 7 lines
lowcomms-tcp.c.new renamed from lowcomms-tcp.c +1 -0
@@ -747,6 +748,7 @@
 	struct connection *con = e->con;
 	int users;
 
+	spin_lock(&con->writequeue_lock);
 	users = --e->users;
 	if (users)
 		goto out;

Hi Patrick,

For what it's worth: I haven't encountered the messages, and my previous checkouts of lowcomms-tcp.c (2747 and 2876 of the RHEL5 kernels) all seem to have these spin_locks already. I've looked through that code pretty
carefully in the recent past and I'm pretty sure the locks match the unlocks in the aforementioned versions. So I'm guessing they were dropped recently by accident.

Regards,

Bob Peterson

#2 lore raw

PATCH 1/1 dlm: Fix spin lock already unlocked bug

In reply to Patrick Caulfield
Quoted 10 lines · Patrick Caulfield
Quoted 1 line

From the "how the hell did that get in there" collection.

I just noticed this message when testing some other changes I'd made to lowcomms (to use workqueues) but the problem seems to be in the current git trees too. I'm amazed no-one has seen it.

   BUG: spinlock already unlocked on CPU#1, dlm_recoverd/16868

Please check this before committing it someone (everyone?), in case I'm hallucinating after all the christmas punch ;-)

Looks good to me (haven't seen it since my test machines are UP). The spin_locks are in the RHEL5 code, I'm not sure how they disappeared upstream.

#3 lore raw

PATCH 1/1 dlm: Fix spin lock already unlocked bug

In reply to Patrick Caulfield
Quoted 11 lines · Patrick Caulfield
Quoted 1 line

From the "how the hell did that get in there" collection.

I just noticed this message when testing some other changes I'd made to lowcomms (to use workqueues) but the problem seems to be in the current git trees too. I'm amazed no-one has seen it.

   BUG: spinlock already unlocked on CPU#1, dlm_recoverd/16868

Please check this before committing it someone (everyone?), in case I'm hallucinating after all the christmas punch ;-)

Patch attached rather than inline...

Signature · 8 lines
patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spinlock.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070102/c94c3cd2/attachment.bin>