61 #define SLOT_DEBUG_LINE 128
75 memset(line, 0,
sizeof(line));
78 for (i = 0; i < array_size; i++) {
82 ret =
snprintf(line + pos, len - pos,
" %d:%d",
83 array[i].
slot, array[i].nodeid);
90 ret =
snprintf(line + pos, len - pos,
" %d:%d",
98 log_debug(ls,
"generation %u slots %d%s", gen, num_slots, line);
115 if (gen <= ls->ls_generation) {
116 log_error(ls,
"dlm_slots_copy_in gen %u old %u",
132 log_debug_slots(ls, gen, num_slots, ro0,
NULL, 0);
143 if (memb->
nodeid == our_nodeid) {
145 log_error(ls,
"dlm_slots_copy_in our slot "
156 log_error(ls,
"dlm_slots_copy_in nodeid %d no slot",
175 int array_size, max_slots,
i;
184 if (memb->
nodeid == our_nodeid) {
197 if (memb->
slot == -1)
209 if (!max || max < memb->
slot)
215 log_error(ls,
"nodeid %d slot changed %d %d",
222 array_size = max + need;
236 if (memb->
slot > array_size) {
253 for (i = 0; i < array_size; i++) {
277 log_debug_slots(ls, gen, num,
NULL, array, array_size);
280 sizeof(struct rcom_config)) / sizeof(struct rcom_slot);
282 if (num > max_slots) {
283 log_error(ls,
"num_slots %d exceeds max_slots %d",
291 *slots_size = array_size;
305 if (new->nodeid < memb->
nodeid)
315 tmp->
prev->next = newlist;
338 add_ordered_member(ls, memb);
348 if (memb->
nodeid == nodeid)
356 if (find_memb(&ls->
ls_nodes, nodeid))
368 static void clear_memb_list(
struct list_head *head)
372 while (!list_empty(head)) {
390 static void make_member_array(
struct dlm_ls *ls)
393 int i,
w,
x = 0, total = 0, all_zero = 0, *array;
417 if (!all_zero && !memb->
weight)
427 for (i = 0; i <
w; i++)
428 array[x++] = memb->
nodeid;
436 static int ping_members(
struct dlm_ls *ls)
442 error = dlm_recovery_stopped(ls);
450 log_debug(ls,
"ping_members aborted %d last nodeid %d",
455 static void dlm_lsop_recover_prep(
struct dlm_ls *ls)
462 static void dlm_lsop_recover_slot(
struct dlm_ls *ls,
struct dlm_member *memb)
479 if (!error && seq == memb->
comm_seq)
506 log_error(ls,
"dlm_lsop_recover_done bad num %d", num);
526 if (rv->
nodes[i].nodeid == nodeid)
549 node = find_config_node(rv, memb->
nodeid);
550 if (node && !node->
new)
557 log_debug(ls,
"remove member %d comm_seq %u %u",
564 dlm_lsop_recover_slot(ls, memb);
573 dlm_add_member(ls, node);
583 make_member_array(ls);
586 error = ping_members(ls);
587 if (!error || error == -
EPROTO) {
673 dlm_lsop_recover_prep(ls);
695 if (!dlm_locking_stopped(ls)) {
697 log_error(ls,
"start ignored: lockspace running");
711 (
unsigned long long)rv_old->seq, rv_old->nodes_count);
712 kfree(rv_old->nodes);