예제 #1
0
static void ocfs2_do_node_down(int node_num,
			       struct ocfs2_super *osb)
{
	BUG_ON(osb->node_num == node_num);

	mlog(0, "ocfs2: node down event for %d\n", node_num);

	if (!osb->dlm) {
		/*
		 * No DLM means we're not even ready to participate yet.
		 * We check the slots after the DLM comes up, so we will
		 * notice the node death then.  We can safely ignore it
		 * here.
		 */
		return;
	}

	if (ocfs2_node_map_test_bit(osb, &osb->umount_map, node_num)) {
		/* If a node is in the umount map, then we've been
		 * expecting him to go down and we know ahead of time
		 * that recovery is not necessary. */
		ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num);
		return;
	}

	ocfs2_recovery_thread(osb, node_num);

	ocfs2_remove_node_from_vote_queues(osb, node_num);
}
예제 #2
0
/*
 * Serialize with orphan dir recovery. If the process doing
 * recovery on this orphan dir does an iget() with the dir
 * i_mutex held, we'll deadlock here. Instead we detect this
 * and exit early - recovery will wipe this inode for us.
 */
static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
					     int slot)
{
	int ret = 0;

	spin_lock(&osb->osb_lock);
	if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) {
		ret = -EDEADLK;
		goto out;
	}
	/* This signals to the orphan recovery process that it should
	 * wait for us to handle the wipe. */
	osb->osb_orphan_wipes[slot]++;
out:
	spin_unlock(&osb->osb_lock);
	trace_ocfs2_check_orphan_recovery_state(slot, ret);
	return ret;
}
예제 #3
0
/* 
 * Serialize with orphan dir recovery. If the process doing
 * recovery on this orphan dir does an iget() with the dir
 * i_mutex held, we'll deadlock here. Instead we detect this
 * and exit early - recovery will wipe this inode for us.
 */
static int ocfs2_check_orphan_recovery_state(struct ocfs2_super *osb,
					     int slot)
{
	int ret = 0;

	spin_lock(&osb->osb_lock);
	if (ocfs2_node_map_test_bit(osb, &osb->osb_recovering_orphan_dirs, slot)) {
		mlog(0, "Recovery is happening on orphan dir %d, will skip "
		     "this inode\n", slot);
		ret = -EDEADLK;
		goto out;
	}
	/* This signals to the orphan recovery process that it should
	 * wait for us to handle the wipe. */
	osb->osb_orphan_wipes[slot]++;
out:
	spin_unlock(&osb->osb_lock);
	return ret;
}