Commit 13e38c8a authored by Sage Weil's avatar Sage Weil

ceph: update to mon client protocol v15

The mon request headers now include session_mon information that must
be properly initialized.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 266673db
...@@ -37,10 +37,10 @@ ...@@ -37,10 +37,10 @@
*/ */
#define CEPH_OSD_PROTOCOL 7 /* cluster internal */ #define CEPH_OSD_PROTOCOL 7 /* cluster internal */
#define CEPH_MDS_PROTOCOL 9 /* cluster internal */ #define CEPH_MDS_PROTOCOL 9 /* cluster internal */
#define CEPH_MON_PROTOCOL 4 /* cluster internal */ #define CEPH_MON_PROTOCOL 5 /* cluster internal */
#define CEPH_OSDC_PROTOCOL 20 /* server/client */ #define CEPH_OSDC_PROTOCOL 20 /* server/client */
#define CEPH_MDSC_PROTOCOL 29 /* server/client */ #define CEPH_MDSC_PROTOCOL 29 /* server/client */
#define CEPH_MONC_PROTOCOL 14 /* server/client */ #define CEPH_MONC_PROTOCOL 15 /* server/client */
#define CEPH_INO_ROOT 1 #define CEPH_INO_ROOT 1
...@@ -118,9 +118,14 @@ struct ceph_file_layout { ...@@ -118,9 +118,14 @@ struct ceph_file_layout {
#define CEPH_MSG_OSD_OP 42 #define CEPH_MSG_OSD_OP 42
#define CEPH_MSG_OSD_OPREPLY 43 #define CEPH_MSG_OSD_OPREPLY 43
struct ceph_mon_request_header {
__le64 have_version;
__le16 session_mon;
__le64 session_mon_tid;
} __attribute__ ((packed));
struct ceph_mon_statfs { struct ceph_mon_statfs {
__le64 have_version; struct ceph_mon_request_header monhdr;
struct ceph_fsid fsid; struct ceph_fsid fsid;
__le64 tid; __le64 tid;
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -138,22 +143,22 @@ struct ceph_mon_statfs_reply { ...@@ -138,22 +143,22 @@ struct ceph_mon_statfs_reply {
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ceph_osd_getmap { struct ceph_osd_getmap {
__le64 have_version; struct ceph_mon_request_header monhdr;
struct ceph_fsid fsid; struct ceph_fsid fsid;
__le32 start; __le32 start;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ceph_mds_getmap { struct ceph_mds_getmap {
__le64 have_version; struct ceph_mon_request_header monhdr;
struct ceph_fsid fsid; struct ceph_fsid fsid;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ceph_client_mount { struct ceph_client_mount {
__le64 have_version; struct ceph_mon_request_header monhdr;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ceph_mon_subscribe_item { struct ceph_mon_subscribe_item {
__le64 have; __le64 have_version; __le64 have;
__u8 onetime; __u8 onetime;
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -857,7 +857,7 @@ static int read_partial_connect(struct ceph_connection *con) ...@@ -857,7 +857,7 @@ static int read_partial_connect(struct ceph_connection *con)
static int verify_hello(struct ceph_connection *con) static int verify_hello(struct ceph_connection *con)
{ {
if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) { if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) {
pr_err("connect to/from %s has bad banner\n", pr_err("connect to %s got bad banner\n",
pr_addr(&con->peer_addr.in_addr)); pr_addr(&con->peer_addr.in_addr));
con->error_msg = "protocol error, bad banner"; con->error_msg = "protocol error, bad banner";
return -1; return -1;
......
...@@ -273,7 +273,9 @@ static void __request_mount(struct ceph_mon_client *monc) ...@@ -273,7 +273,9 @@ static void __request_mount(struct ceph_mon_client *monc)
if (IS_ERR(msg)) if (IS_ERR(msg))
return; return;
h = msg->front.iov_base; h = msg->front.iov_base;
h->have_version = 0; h->monhdr.have_version = 0;
h->monhdr.session_mon = cpu_to_le16(-1);
h->monhdr.session_mon_tid = 0;
ceph_con_send(monc->con, msg); ceph_con_send(monc->con, msg);
} }
...@@ -422,7 +424,9 @@ static int send_statfs(struct ceph_mon_client *monc, ...@@ -422,7 +424,9 @@ static int send_statfs(struct ceph_mon_client *monc,
return PTR_ERR(msg); return PTR_ERR(msg);
req->request = msg; req->request = msg;
h = msg->front.iov_base; h = msg->front.iov_base;
h->have_version = 0; h->monhdr.have_version = 0;
h->monhdr.session_mon = cpu_to_le16(-1);
h->monhdr.session_mon_tid = 0;
h->fsid = monc->monmap->fsid; h->fsid = monc->monmap->fsid;
h->tid = cpu_to_le64(req->tid); h->tid = cpu_to_le64(req->tid);
ceph_con_send(monc->con, msg); ceph_con_send(monc->con, msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment