struct ldlm_lock *lock = NULL, *retval = NULL;
ENTRY;
- if (!handle || !handle->addr)
+ if (!handle || !handle->addr) {
+ CERROR("bogus handle %p->"LPX64"\n", handle,
+ handle ? handle->addr : -1);
RETURN(NULL);
+ }
lock = (struct ldlm_lock *)(unsigned long)(handle->addr);
- if (!kmem_cache_validate(ldlm_lock_slab, (void *)lock))
+ if (!kmem_cache_validate(ldlm_lock_slab, (void *)lock)) {
+ CERROR("bogus lock %p\n", lock);
RETURN(NULL);
+ }
if (!lock->l_resource) {
CERROR("trying to lock bogus resource: lock %p\n", lock);
RETURN(NULL);
}
l_lock(&lock->l_resource->lr_namespace->ns_lock);
- if (lock->l_random != handle->cookie)
+ if (lock->l_random != handle->cookie) {
+ CERROR("bogus cookie: lock "LPX64", handle "LPX64"\n",
+ lock->l_random, handle->cookie);
GOTO(out, NULL);
+ }
- if (lock->l_flags & LDLM_FL_DESTROYED)
+ if (lock->l_flags & LDLM_FL_DESTROYED) {
+ CERROR("lock already destroyed: lock %p\n", lock);
+ LDLM_DEBUG(lock, "ldlm_handle2lock(%p)", lock);
GOTO(out, NULL);
+ }
retval = LDLM_LOCK_GET(lock);
+ if (!retval)
+ CERROR("lock disappeared below us!!! %p\n", lock);
EXIT;
out:
l_unlock(&lock->l_resource->lr_namespace->ns_lock);
int rc;
ENTRY;
+ CERROR("pt 1\n");
rc = lustre_pack_msg(0, NULL, NULL, &req->rq_replen, &req->rq_repmsg);
if (rc) {
CERROR("out of memory\n");
RETURN(-ENOMEM);
}
+ CERROR("pt 2\n");
dlm_req = lustre_msg_buf(req->rq_reqmsg, 0);
if (!dlm_req) {
CERROR("bad request buffer for cancel\n");
RETURN(-EINVAL);
}
+ CERROR("pt 3\n");
lock = ldlm_handle2lock(&dlm_req->lock_handle1);
if (!lock) {
+ CERROR("bad lock handle\n");
LDLM_DEBUG_NOLOCK("server-side cancel handler stale lock (lock "
"%p)", (void *)(unsigned long)
dlm_req->lock_handle1.addr);
req->rq_status = ESTALE;
} else {
+ CERROR("pt 4\n");
LDLM_DEBUG(lock, "server-side cancel handler START");
ldlm_lock_cancel(lock);
if (ldlm_del_waiting_lock(lock))
LBUG();
if (lock) {
+ CERROR("pt 5\n");
ldlm_reprocess_all(lock->l_resource);
LDLM_DEBUG(lock, "server-side cancel handler END");
LDLM_LOCK_PUT(lock);