]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[DLM] Fix spin lock already unlocked bug
authorPatrick Caulfield <pcaulfie@redhat.com>
Tue, 2 Jan 2007 17:08:54 +0000 (17:08 +0000)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 5 Feb 2007 18:36:21 +0000 (13:36 -0500)
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

Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lowcomms-tcp.c

index 18b91c65bdb3156a58a2435311c0b27fc98fa9f7..ce5e7cdfb45d48e64b66aaf8785f05729cbbd6b6 100644 (file)
@@ -709,6 +709,7 @@ void *dlm_lowcomms_get_buffer(int nodeid, int len,
        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 @@ void dlm_lowcomms_commit_buffer(void *mh)
        struct connection *con = e->con;
        int users;
 
+       spin_lock(&con->writequeue_lock);
        users = --e->users;
        if (users)
                goto out;