|
@@ -2519,6 +2519,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
|
|
spin_lock(&dlm->master_lock);
|
|
spin_lock(&dlm->master_lock);
|
|
ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name,
|
|
ret = dlm_add_migration_mle(dlm, res, mle, &oldmle, name,
|
|
namelen, target, dlm->node_num);
|
|
namelen, target, dlm->node_num);
|
|
|
|
+ /* get an extra reference on the mle.
|
|
|
|
+ * otherwise the assert_master from the new
|
|
|
|
+ * master will destroy this.
|
|
|
|
+ */
|
|
|
|
+ dlm_get_mle_inuse(mle);
|
|
spin_unlock(&dlm->master_lock);
|
|
spin_unlock(&dlm->master_lock);
|
|
spin_unlock(&dlm->spinlock);
|
|
spin_unlock(&dlm->spinlock);
|
|
|
|
|
|
@@ -2554,6 +2559,7 @@ fail:
|
|
if (mle_added) {
|
|
if (mle_added) {
|
|
dlm_mle_detach_hb_events(dlm, mle);
|
|
dlm_mle_detach_hb_events(dlm, mle);
|
|
dlm_put_mle(mle);
|
|
dlm_put_mle(mle);
|
|
|
|
+ dlm_put_mle_inuse(mle);
|
|
} else if (mle) {
|
|
} else if (mle) {
|
|
kmem_cache_free(dlm_mle_cache, mle);
|
|
kmem_cache_free(dlm_mle_cache, mle);
|
|
mle = NULL;
|
|
mle = NULL;
|
|
@@ -2571,17 +2577,6 @@ fail:
|
|
* ensure that all assert_master work is flushed. */
|
|
* ensure that all assert_master work is flushed. */
|
|
flush_workqueue(dlm->dlm_worker);
|
|
flush_workqueue(dlm->dlm_worker);
|
|
|
|
|
|
- /* get an extra reference on the mle.
|
|
|
|
- * otherwise the assert_master from the new
|
|
|
|
- * master will destroy this.
|
|
|
|
- * also, make sure that all callers of dlm_get_mle
|
|
|
|
- * take both dlm->spinlock and dlm->master_lock */
|
|
|
|
- spin_lock(&dlm->spinlock);
|
|
|
|
- spin_lock(&dlm->master_lock);
|
|
|
|
- dlm_get_mle_inuse(mle);
|
|
|
|
- spin_unlock(&dlm->master_lock);
|
|
|
|
- spin_unlock(&dlm->spinlock);
|
|
|
|
-
|
|
|
|
/* notify new node and send all lock state */
|
|
/* notify new node and send all lock state */
|
|
/* call send_one_lockres with migration flag.
|
|
/* call send_one_lockres with migration flag.
|
|
* this serves as notice to the target node that a
|
|
* this serves as notice to the target node that a
|
|
@@ -3312,6 +3307,15 @@ top:
|
|
mle->new_master != dead_node)
|
|
mle->new_master != dead_node)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
+ if (mle->new_master == dead_node && mle->inuse) {
|
|
|
|
+ mlog(ML_NOTICE, "%s: target %u died during "
|
|
|
|
+ "migration from %u, the MLE is "
|
|
|
|
+ "still keep used, ignore it!\n",
|
|
|
|
+ dlm->name, dead_node,
|
|
|
|
+ mle->master);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* If we have reached this point, this mle needs to be
|
|
/* If we have reached this point, this mle needs to be
|
|
* removed from the list and freed. */
|
|
* removed from the list and freed. */
|
|
dlm_clean_migration_mle(dlm, mle);
|
|
dlm_clean_migration_mle(dlm, mle);
|