/* someone won the race and added the resource before */
ldlm_resource_getref(old_res);
cfs_spin_unlock(&ns->ns_hash_lock);
+ /* clean lu_ref for failed resource */
+ lu_ref_fini(&res->lr_reference);
OBD_SLAB_FREE(res, ldlm_resource_slab, sizeof *res);
/* synchronize WRT resource creation */
if (ns->ns_lvbo && ns->ns_lvbo->lvbo_init) {