Loading fs/dlm/dlm_internal.h +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <linux/miscdevice.h> #include <linux/mutex.h> #include <linux/idr.h> #include <linux/ratelimit.h> #include <asm/uaccess.h> #include <linux/dlm.h> Loading Loading @@ -74,6 +75,13 @@ do { \ (ls)->ls_name , ##args); \ } while (0) #define log_limit(ls, fmt, args...) \ do { \ if (dlm_config.ci_log_debug) \ printk_ratelimited(KERN_DEBUG "dlm: %s: " fmt "\n", \ (ls)->ls_name , ##args); \ } while (0) #define DLM_ASSERT(x, do) \ { \ if (!(x)) \ Loading fs/dlm/rcom.c +20 −28 Original line number Diff line number Diff line Loading @@ -486,47 +486,39 @@ int dlm_send_ls_not_ready(int nodeid, struct dlm_rcom *rc_in) return 0; } static int is_old_reply(struct dlm_ls *ls, struct dlm_rcom *rc) /* Called by dlm_recv; corresponds to dlm_receive_message() but special recovery-only comms are sent through here. */ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) { int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock); int stop, reply = 0; uint64_t seq; int rv = 0; switch (rc->rc_type) { case DLM_RCOM_STATUS_REPLY: case DLM_RCOM_NAMES_REPLY: case DLM_RCOM_LOOKUP_REPLY: case DLM_RCOM_LOCK_REPLY: reply = 1; }; spin_lock(&ls->ls_recover_lock); stop = test_bit(LSFL_RECOVERY_STOP, &ls->ls_flags); seq = ls->ls_recover_seq; spin_unlock(&ls->ls_recover_lock); if (rc->rc_seq_reply != seq) { log_debug(ls, "ignoring old reply %x from %d " "seq_reply %llx expect %llx", rc->rc_type, rc->rc_header.h_nodeid, if ((stop && (rc->rc_type != DLM_RCOM_STATUS)) || (reply && (rc->rc_seq_reply != seq))) { log_limit(ls, "dlm_receive_rcom ignore msg %d " "from %d %llu %llu seq %llu", rc->rc_type, nodeid, (unsigned long long)rc->rc_seq, (unsigned long long)rc->rc_seq_reply, (unsigned long long)seq); rv = 1; } } return rv; } /* Called by dlm_recv; corresponds to dlm_receive_message() but special recovery-only comms are sent through here. */ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) { int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock); if (dlm_recovery_stopped(ls) && (rc->rc_type != DLM_RCOM_STATUS)) { log_debug(ls, "ignoring recovery message %x from %d", rc->rc_type, nodeid); goto out; } if (is_old_reply(ls, rc)) goto out; switch (rc->rc_type) { case DLM_RCOM_STATUS: receive_rcom_status(ls, rc); Loading Loading
fs/dlm/dlm_internal.h +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ #include <linux/miscdevice.h> #include <linux/mutex.h> #include <linux/idr.h> #include <linux/ratelimit.h> #include <asm/uaccess.h> #include <linux/dlm.h> Loading Loading @@ -74,6 +75,13 @@ do { \ (ls)->ls_name , ##args); \ } while (0) #define log_limit(ls, fmt, args...) \ do { \ if (dlm_config.ci_log_debug) \ printk_ratelimited(KERN_DEBUG "dlm: %s: " fmt "\n", \ (ls)->ls_name , ##args); \ } while (0) #define DLM_ASSERT(x, do) \ { \ if (!(x)) \ Loading
fs/dlm/rcom.c +20 −28 Original line number Diff line number Diff line Loading @@ -486,47 +486,39 @@ int dlm_send_ls_not_ready(int nodeid, struct dlm_rcom *rc_in) return 0; } static int is_old_reply(struct dlm_ls *ls, struct dlm_rcom *rc) /* Called by dlm_recv; corresponds to dlm_receive_message() but special recovery-only comms are sent through here. */ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) { int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock); int stop, reply = 0; uint64_t seq; int rv = 0; switch (rc->rc_type) { case DLM_RCOM_STATUS_REPLY: case DLM_RCOM_NAMES_REPLY: case DLM_RCOM_LOOKUP_REPLY: case DLM_RCOM_LOCK_REPLY: reply = 1; }; spin_lock(&ls->ls_recover_lock); stop = test_bit(LSFL_RECOVERY_STOP, &ls->ls_flags); seq = ls->ls_recover_seq; spin_unlock(&ls->ls_recover_lock); if (rc->rc_seq_reply != seq) { log_debug(ls, "ignoring old reply %x from %d " "seq_reply %llx expect %llx", rc->rc_type, rc->rc_header.h_nodeid, if ((stop && (rc->rc_type != DLM_RCOM_STATUS)) || (reply && (rc->rc_seq_reply != seq))) { log_limit(ls, "dlm_receive_rcom ignore msg %d " "from %d %llu %llu seq %llu", rc->rc_type, nodeid, (unsigned long long)rc->rc_seq, (unsigned long long)rc->rc_seq_reply, (unsigned long long)seq); rv = 1; } } return rv; } /* Called by dlm_recv; corresponds to dlm_receive_message() but special recovery-only comms are sent through here. */ void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) { int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock); if (dlm_recovery_stopped(ls) && (rc->rc_type != DLM_RCOM_STATUS)) { log_debug(ls, "ignoring recovery message %x from %d", rc->rc_type, nodeid); goto out; } if (is_old_reply(ls, rc)) goto out; switch (rc->rc_type) { case DLM_RCOM_STATUS: receive_rcom_status(ls, rc); Loading