/* It's unlikely but possible that someone marked the lock as
* destroyed after we did handle2object on it */
if ((flags == 0) && !ldlm_is_destroyed(lock)) {
- lu_ref_add(&lock->l_reference, "handle", current);
+ lu_ref_add_atomic(&lock->l_reference, "handle", current);
RETURN(lock);
}
arg->gl_interpret_data = gl_work->gl_interpret_data;
/* invoke the actual glimpse callback */
- if (lock->l_glimpse_ast(lock, (void*)arg) == 0)
- rc = 1;
+ rc = lock->l_glimpse_ast(lock, (void *)arg);
+ if (rc == 0)
+ rc = 1; /* update LVB if this is server lock */
+ else if (rc == -ELDLM_NO_LOCK_DATA)
+ ldlm_lvbo_update(lock->l_resource, lock, NULL, 1);
LDLM_LOCK_RELEASE(lock);
if (gl_work->gl_flags & LDLM_GL_WORK_SLAB_ALLOCATED)