]> err.no Git - linux-2.6/blobdiff - fs/dlm/rcom.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
[linux-2.6] / fs / dlm / rcom.c
index 521ad9bb47b7c7ae86d9baaa86b9e55cdcb957d0..6bfbd61538094f72cb1001bc782cc246faf55552 100644 (file)
@@ -82,8 +82,17 @@ static void make_config(struct dlm_ls *ls, struct rcom_config *rf)
        rf->rf_lsflags = ls->ls_exflags;
 }
 
-static int check_config(struct dlm_ls *ls, struct rcom_config *rf, int nodeid)
+static int check_config(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
 {
+       struct rcom_config *rf = (struct rcom_config *) rc->rc_buf;
+
+       if ((rc->rc_header.h_version & 0xFFFF0000) != DLM_HEADER_MAJOR) {
+               log_error(ls, "version mismatch: %x nodeid %d: %x",
+                         DLM_HEADER_MAJOR | DLM_HEADER_MINOR, nodeid,
+                         rc->rc_header.h_version);
+               return -EINVAL;
+       }
+
        if (rf->rf_lvblen != ls->ls_lvblen ||
            rf->rf_lsflags != ls->ls_exflags) {
                log_error(ls, "config mismatch: %d,%x nodeid %d: %d,%x",
@@ -129,7 +138,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
                goto out;
 
        allow_sync_reply(ls, &rc->rc_id);
-       memset(ls->ls_recover_buf, 0, dlm_config.buffer_size);
+       memset(ls->ls_recover_buf, 0, dlm_config.ci_buffer_size);
 
        send_rcom(ls, mh, rc);
 
@@ -145,8 +154,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid)
                log_debug(ls, "remote node %d not ready", nodeid);
                rc->rc_result = 0;
        } else
-               error = check_config(ls, (struct rcom_config *) rc->rc_buf,
-                                    nodeid);
+               error = check_config(ls, rc, nodeid);
        /* the caller looks at rc_result for the remote recovery status */
  out:
        return error;
@@ -205,7 +213,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
        if (nodeid == dlm_our_nodeid()) {
                dlm_copy_master_names(ls, last_name, last_len,
                                      ls->ls_recover_buf + len,
-                                     dlm_config.buffer_size - len, nodeid);
+                                     dlm_config.ci_buffer_size - len, nodeid);
                goto out;
        }
 
@@ -215,7 +223,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
        memcpy(rc->rc_buf, last_name, last_len);
 
        allow_sync_reply(ls, &rc->rc_id);
-       memset(ls->ls_recover_buf, 0, dlm_config.buffer_size);
+       memset(ls->ls_recover_buf, 0, dlm_config.ci_buffer_size);
 
        send_rcom(ls, mh, rc);
 
@@ -233,7 +241,7 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)
 
        nodeid = rc_in->rc_header.h_nodeid;
        inlen = rc_in->rc_header.h_length - sizeof(struct dlm_rcom);
-       outlen = dlm_config.buffer_size - sizeof(struct dlm_rcom);
+       outlen = dlm_config.ci_buffer_size - sizeof(struct dlm_rcom);
 
        error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen, &rc, &mh);
        if (error)
@@ -427,7 +435,7 @@ static int is_old_reply(struct dlm_ls *ls, struct dlm_rcom *rc)
                seq = ls->ls_recover_seq;
                spin_unlock(&ls->ls_recover_lock);
                if (rc->rc_seq_reply != seq) {
-                       log_error(ls, "ignoring old reply %x from %d "
+                       log_debug(ls, "ignoring old reply %x from %d "
                                      "seq_reply %llx expect %llx",
                                      rc->rc_type, rc->rc_header.h_nodeid,
                                      (unsigned long long)rc->rc_seq_reply,
@@ -461,7 +469,7 @@ void dlm_receive_rcom(struct dlm_header *hd, int nodeid)
        }
 
        if (dlm_recovery_stopped(ls) && (rc->rc_type != DLM_RCOM_STATUS)) {
-               log_error(ls, "ignoring recovery message %x from %d",
+               log_debug(ls, "ignoring recovery message %x from %d",
                          rc->rc_type, nodeid);
                goto out;
        }