@@ -302,6 +302,7 @@
#define OBD_FAIL_LDLM_CP_CB_WAIT5 0x323
#define OBD_FAIL_LDLM_GRANT_CHECK 0x32a
+#define OBD_FAIL_LDLM_LOCAL_CANCEL_PAUSE 0x32c
/* LOCKLESS IO */
#define OBD_FAIL_LDLM_SET_CONTENTION 0x385
@@ -149,9 +149,6 @@ void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
}
ldlm_set_cbpending(lock);
- if (ldlm_is_cancel_on_block(lock))
- ldlm_set_cancel(lock);
-
do_ast = !lock->l_readers && !lock->l_writers;
unlock_res_and_lock(lock);
@@ -1293,6 +1293,10 @@ int ldlm_cli_cancel(const struct lustre_handle *lockh,
ldlm_set_canceling(lock);
unlock_res_and_lock(lock);
+ if (cancel_flags & LCF_LOCAL)
+ OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_LOCAL_CANCEL_PAUSE,
+ cfs_fail_val);
+
rc = ldlm_cli_cancel_local(lock);
if (rc == LDLM_FL_LOCAL_ONLY || cancel_flags & LCF_LOCAL) {
LDLM_LOCK_RELEASE(lock);
@@ -3934,7 +3934,9 @@ int ll_migrate(struct inode *parent, struct file *file, struct lmv_user_md *lum,
if (!rc) {
LASSERT(request);
ll_update_times(request, parent);
+ }
+ if (rc == 0 || rc == -EAGAIN) {
body = req_capsule_server_get(&request->rq_pill, &RMF_MDT_BODY);
LASSERT(body);
@@ -3957,7 +3959,7 @@ int ll_migrate(struct inode *parent, struct file *file, struct lmv_user_md *lum,
request = NULL;
}
- /* Try again if the file layout has changed. */
+ /* Try again if the lease has cancelled. */
if (rc == -EAGAIN && S_ISREG(child_inode->i_mode))
goto again;