[GFS2] match plock result with correct request
[pandora-kernel.git] / fs / gfs2 / locking / dlm / plock.c
index f7ac582..1acb251 100644 (file)
@@ -70,13 +70,14 @@ int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
                return -ENOMEM;
 
        op->info.optype         = GDLM_PLOCK_OP_LOCK;
-       op->info.pid            = (uint32_t) fl->fl_owner;
+       op->info.pid            = fl->fl_pid;
        op->info.ex             = (fl->fl_type == F_WRLCK);
        op->info.wait           = IS_SETLKW(cmd);
        op->info.fsid           = ls->id;
        op->info.number         = name->ln_number;
        op->info.start          = fl->fl_start;
        op->info.end            = fl->fl_end;
+       op->info.owner          = (__u64)(long) fl->fl_owner;
 
        send_op(op);
        wait_event(recv_wq, (op->done != 0));
@@ -93,7 +94,8 @@ int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
        if (!rv) {
                if (posix_lock_file_wait(file, fl) < 0)
                        log_error("gdlm_plock: vfs lock error %x,%llx",
-                                 name->ln_type, name->ln_number);
+                                 name->ln_type,
+                                 (unsigned long long)name->ln_number);
        }
 
        kfree(op);
@@ -113,14 +115,15 @@ int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
 
        if (posix_lock_file_wait(file, fl) < 0)
                log_error("gdlm_punlock: vfs unlock error %x,%llx",
-                         name->ln_type, name->ln_number);
+                         name->ln_type, (unsigned long long)name->ln_number);
 
        op->info.optype         = GDLM_PLOCK_OP_UNLOCK;
-       op->info.pid            = (uint32_t) fl->fl_owner;
+       op->info.pid            = fl->fl_pid;
        op->info.fsid           = ls->id;
        op->info.number         = name->ln_number;
        op->info.start          = fl->fl_start;
        op->info.end            = fl->fl_end;
+       op->info.owner          = (__u64)(long) fl->fl_owner;
 
        send_op(op);
        wait_event(recv_wq, (op->done != 0));
@@ -150,7 +153,7 @@ int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
                return -ENOMEM;
 
        op->info.optype         = GDLM_PLOCK_OP_GET;
-       op->info.pid            = (uint32_t) fl->fl_owner;
+       op->info.pid            = fl->fl_pid;
        op->info.ex             = (fl->fl_type == F_WRLCK);
        op->info.fsid           = ls->id;
        op->info.number         = name->ln_number;
@@ -229,7 +232,8 @@ 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) {
+                   op->info.number == info.number &&
+                   op->info.owner == info.owner) {
                        list_del_init(&op->list);
                        found = 1;
                        op->done = 1;
@@ -243,7 +247,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
                wake_up(&recv_wq);
        else
                printk(KERN_INFO "gdlm dev_write no op %x %llx\n", info.fsid,
-                       info.number);
+                       (unsigned long long)info.number);
        return count;
 }