rcom.c (d6e24788d21c4f1a8f00c811c31dd4e9a58679ac) rcom.c (4875647a08e35f77274838d97ca8fa44158d50e2)
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
6**
7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions

--- 478 unchanged lines hidden (view full) ---

487}
488
489/* Called by dlm_recv; corresponds to dlm_receive_message() but special
490 recovery-only comms are sent through here. */
491
492void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
493{
494 int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock);
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
6**
7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions

--- 478 unchanged lines hidden (view full) ---

487}
488
489/* Called by dlm_recv; corresponds to dlm_receive_message() but special
490 recovery-only comms are sent through here. */
491
492void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
493{
494 int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock);
495 int stop, reply = 0;
495 int stop, reply = 0, lock = 0;
496 uint32_t status;
496 uint64_t seq;
497
498 switch (rc->rc_type) {
497 uint64_t seq;
498
499 switch (rc->rc_type) {
500 case DLM_RCOM_LOCK:
501 lock = 1;
502 break;
503 case DLM_RCOM_LOCK_REPLY:
504 lock = 1;
505 reply = 1;
506 break;
499 case DLM_RCOM_STATUS_REPLY:
500 case DLM_RCOM_NAMES_REPLY:
501 case DLM_RCOM_LOOKUP_REPLY:
507 case DLM_RCOM_STATUS_REPLY:
508 case DLM_RCOM_NAMES_REPLY:
509 case DLM_RCOM_LOOKUP_REPLY:
502 case DLM_RCOM_LOCK_REPLY:
503 reply = 1;
504 };
505
506 spin_lock(&ls->ls_recover_lock);
510 reply = 1;
511 };
512
513 spin_lock(&ls->ls_recover_lock);
514 status = ls->ls_recover_status;
507 stop = test_bit(LSFL_RECOVERY_STOP, &ls->ls_flags);
508 seq = ls->ls_recover_seq;
509 spin_unlock(&ls->ls_recover_lock);
510
511 if ((stop && (rc->rc_type != DLM_RCOM_STATUS)) ||
515 stop = test_bit(LSFL_RECOVERY_STOP, &ls->ls_flags);
516 seq = ls->ls_recover_seq;
517 spin_unlock(&ls->ls_recover_lock);
518
519 if ((stop && (rc->rc_type != DLM_RCOM_STATUS)) ||
512 (reply && (rc->rc_seq_reply != seq))) {
520 (reply && (rc->rc_seq_reply != seq)) ||
521 (lock && !(status & DLM_RS_DIR))) {
513 log_limit(ls, "dlm_receive_rcom ignore msg %d "
522 log_limit(ls, "dlm_receive_rcom ignore msg %d "
514 "from %d %llu %llu seq %llu",
515 rc->rc_type, nodeid,
523 "from %d %llu %llu recover seq %llu sts %x gen %u",
524 rc->rc_type,
525 nodeid,
516 (unsigned long long)rc->rc_seq,
517 (unsigned long long)rc->rc_seq_reply,
526 (unsigned long long)rc->rc_seq,
527 (unsigned long long)rc->rc_seq_reply,
518 (unsigned long long)seq);
528 (unsigned long long)seq,
529 status, ls->ls_generation);
519 goto out;
520 }
521
522 switch (rc->rc_type) {
523 case DLM_RCOM_STATUS:
524 receive_rcom_status(ls, rc);
525 break;
526

--- 42 unchanged lines hidden ---
530 goto out;
531 }
532
533 switch (rc->rc_type) {
534 case DLM_RCOM_STATUS:
535 receive_rcom_status(ls, rc);
536 break;
537

--- 42 unchanged lines hidden ---