* GPL HEADER END
*/
/*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann.lombardi@intel.com>
qqi = lock->l_ast_data;
if (qqi != NULL) {
qqi_getref(qqi);
- lu_ref_add(&qqi->qqi_reference, "ast_data_get", lock);
if (reset)
lock->l_ast_data = NULL;
}
unlock_res_and_lock(lock);
+ if (qqi != NULL)
+ /* it is not safe to call lu_ref_add() under spinlock */
+ lu_ref_add(&qqi->qqi_reference, "ast_data_get", lock);
+
if (reset && qqi != NULL) {
/* release qqi reference hold for the lock */
- qqi_putref(qqi);
lu_ref_del(&qqi->qqi_reference, "glb_lock", lock);
+ qqi_putref(qqi);
}
RETURN(qqi);
}
LDLM_DEBUG(lock, "blocking AST on global quota lock");
ldlm_lock2handle(lock, &lockh);
- rc = ldlm_cli_cancel(&lockh);
+ rc = ldlm_cli_cancel(&lockh, LCF_ASYNC);
break;
}
case LDLM_CB_CANCELING: {
LDLM_DEBUG(lock, "blocking AST on ID quota lock");
ldlm_lock2handle(lock, &lockh);
- rc = ldlm_cli_cancel(&lockh);
+ rc = ldlm_cli_cancel(&lockh, LCF_ASYNC);
break;
}
case LDLM_CB_CANCELING: {
ldlm_lock_dump_handle(D_QUOTA, lockh);
if (rlockh == NULL)
+ /* caller not interested in remote handle */
RETURN(0);
/* look up lock associated with local handle and extract remote handle