}
        }
 
+       /* Clean up join state on node death. */
+       if (dlm->joining_node == idx) {
+               mlog(0, "Clearing join state for node %u\n", idx);
+               __dlm_set_joining_node(dlm, DLM_LOCK_RES_OWNER_UNKNOWN);
+       }
+
        /* check to see if the node is already considered dead */
        if (!test_bit(idx, dlm->live_nodes_map)) {
                mlog(0, "for domain %s, node %d is already dead. "
 
        clear_bit(idx, dlm->live_nodes_map);
 
-       /* Clean up join state on node death. */
-       if (dlm->joining_node == idx) {
-               mlog(0, "Clearing join state for node %u\n", idx);
-               __dlm_set_joining_node(dlm, DLM_LOCK_RES_OWNER_UNKNOWN);
-       }
-
        /* make sure local cleanup occurs before the heartbeat events */
        if (!test_bit(idx, dlm->recovery_map))
                dlm_do_local_recovery_cleanup(dlm, idx);