From e4d10dcd4ea4d8b4b4aa8f1bdd92802aefc2e2b7 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 18 Jun 2009 13:20:24 -0500 Subject: [PATCH] --- yaml --- r: 155482 b: refs/heads/master c: c78a87d0a1fc885dfdbe21fd5e07787691dfb068 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/dlm/plock.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 57361f281048..7afeef33ad22 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a566a6b11c86147fe9fc9db7ab15f9eecca3e862 +refs/heads/master: c78a87d0a1fc885dfdbe21fd5e07787691dfb068 diff --git a/trunk/fs/dlm/plock.c b/trunk/fs/dlm/plock.c index 894a32d438d5..16f682e26c07 100644 --- a/trunk/fs/dlm/plock.c +++ b/trunk/fs/dlm/plock.c @@ -353,7 +353,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, { struct dlm_plock_info info; struct plock_op *op; - int found = 0; + int found = 0, do_callback = 0; if (count != sizeof(info)) return -EINVAL; @@ -366,21 +366,24 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, spin_lock(&ops_lock); list_for_each_entry(op, &recv_list, list) { - if (op->info.fsid == info.fsid && op->info.number == info.number && + if (op->info.fsid == info.fsid && + op->info.number == info.number && op->info.owner == info.owner) { + struct plock_xop *xop = (struct plock_xop *)op; list_del_init(&op->list); - found = 1; - op->done = 1; memcpy(&op->info, &info, sizeof(info)); + if (xop->callback) + do_callback = 1; + else + op->done = 1; + found = 1; break; } } spin_unlock(&ops_lock); if (found) { - struct plock_xop *xop; - xop = (struct plock_xop *)op; - if (xop->callback) + if (do_callback) dlm_plock_callback(op); else wake_up(&recv_wq);