@@ -332,6 +332,7 @@
#define OBD_FAIL_OSC_CONNECT_GRANT_PARAM 0x413
#define OBD_FAIL_OSC_DELAY_IO 0x414
#define OBD_FAIL_OSC_NO_SIZE_DATA 0x415
+#define OBD_FAIL_OSC_DELAY_CANCEL 0x416
#define OBD_FAIL_PTLRPC 0x500
#define OBD_FAIL_PTLRPC_ACK 0x501
@@ -313,7 +313,6 @@ static int mdc_dlm_blocking_ast0(const struct lu_env *env,
if (dlmlock->l_ast_data) {
obj = osc2cl(dlmlock->l_ast_data);
- dlmlock->l_ast_data = NULL;
cl_object_get(obj);
}
unlock_res_and_lock(dlmlock);
@@ -332,6 +331,7 @@ static int mdc_dlm_blocking_ast0(const struct lu_env *env,
*/
/* losing a lock, update kms */
lock_res_and_lock(dlmlock);
+ dlmlock->l_ast_data = NULL;
cl_object_attr_lock(obj);
attr->cat_kms = 0;
cl_object_attr_update(env, obj, attr, CAT_KMS);
@@ -419,13 +419,13 @@ static int __osc_dlm_blocking_ast(const struct lu_env *env,
if (dlmlock->l_ast_data) {
obj = osc2cl(dlmlock->l_ast_data);
- dlmlock->l_ast_data = NULL;
-
cl_object_get(obj);
}
unlock_res_and_lock(dlmlock);
+ OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_CANCEL, 5);
+
/* if l_ast_data is NULL, the dlmlock was enqueued by AGL or
* the object has been destroyed.
*/
@@ -442,6 +442,10 @@ static int __osc_dlm_blocking_ast(const struct lu_env *env,
/* losing a lock, update kms */
lock_res_and_lock(dlmlock);
+ /* clearing l_ast_data after flushing data,
+ * to let glimpse ast find the lock and the object
+ */
+ dlmlock->l_ast_data = NULL;
cl_object_attr_lock(obj);
/* Must get the value under the lock to avoid race. */
old_kms = cl2osc(obj)->oo_oinfo->loi_kms;