diff options
author | Sage Weil <sage@newdream.net> | 2009-10-09 19:36:34 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-10-09 19:39:27 -0400 |
commit | 13e38c8ae771d73bf6d1f0f98e35f99c0f0d48ff (patch) | |
tree | cdc48759a7edc26e34b00cc0ddffc6ae58bafaf4 /fs | |
parent | 266673db423e6ab247170d6c6d72ec36e530a911 (diff) |
ceph: update to mon client protocol v15
The mon request headers now include session_mon information that must
be properly initialized.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/ceph_fs.h | 19 | ||||
-rw-r--r-- | fs/ceph/messenger.c | 2 | ||||
-rw-r--r-- | fs/ceph/mon_client.c | 8 |
3 files changed, 19 insertions, 10 deletions
diff --git a/fs/ceph/ceph_fs.h b/fs/ceph/ceph_fs.h index 21ed51b127f2..acf24c6944c7 100644 --- a/fs/ceph/ceph_fs.h +++ b/fs/ceph/ceph_fs.h | |||
@@ -37,10 +37,10 @@ | |||
37 | */ | 37 | */ |
38 | #define CEPH_OSD_PROTOCOL 7 /* cluster internal */ | 38 | #define CEPH_OSD_PROTOCOL 7 /* cluster internal */ |
39 | #define CEPH_MDS_PROTOCOL 9 /* cluster internal */ | 39 | #define CEPH_MDS_PROTOCOL 9 /* cluster internal */ |
40 | #define CEPH_MON_PROTOCOL 4 /* cluster internal */ | 40 | #define CEPH_MON_PROTOCOL 5 /* cluster internal */ |
41 | #define CEPH_OSDC_PROTOCOL 20 /* server/client */ | 41 | #define CEPH_OSDC_PROTOCOL 20 /* server/client */ |
42 | #define CEPH_MDSC_PROTOCOL 29 /* server/client */ | 42 | #define CEPH_MDSC_PROTOCOL 29 /* server/client */ |
43 | #define CEPH_MONC_PROTOCOL 14 /* server/client */ | 43 | #define CEPH_MONC_PROTOCOL 15 /* server/client */ |
44 | 44 | ||
45 | 45 | ||
46 | #define CEPH_INO_ROOT 1 | 46 | #define CEPH_INO_ROOT 1 |
@@ -118,9 +118,14 @@ struct ceph_file_layout { | |||
118 | #define CEPH_MSG_OSD_OP 42 | 118 | #define CEPH_MSG_OSD_OP 42 |
119 | #define CEPH_MSG_OSD_OPREPLY 43 | 119 | #define CEPH_MSG_OSD_OPREPLY 43 |
120 | 120 | ||
121 | struct ceph_mon_request_header { | ||
122 | __le64 have_version; | ||
123 | __le16 session_mon; | ||
124 | __le64 session_mon_tid; | ||
125 | } __attribute__ ((packed)); | ||
121 | 126 | ||
122 | struct ceph_mon_statfs { | 127 | struct ceph_mon_statfs { |
123 | __le64 have_version; | 128 | struct ceph_mon_request_header monhdr; |
124 | struct ceph_fsid fsid; | 129 | struct ceph_fsid fsid; |
125 | __le64 tid; | 130 | __le64 tid; |
126 | } __attribute__ ((packed)); | 131 | } __attribute__ ((packed)); |
@@ -138,22 +143,22 @@ struct ceph_mon_statfs_reply { | |||
138 | } __attribute__ ((packed)); | 143 | } __attribute__ ((packed)); |
139 | 144 | ||
140 | struct ceph_osd_getmap { | 145 | struct ceph_osd_getmap { |
141 | __le64 have_version; | 146 | struct ceph_mon_request_header monhdr; |
142 | struct ceph_fsid fsid; | 147 | struct ceph_fsid fsid; |
143 | __le32 start; | 148 | __le32 start; |
144 | } __attribute__ ((packed)); | 149 | } __attribute__ ((packed)); |
145 | 150 | ||
146 | struct ceph_mds_getmap { | 151 | struct ceph_mds_getmap { |
147 | __le64 have_version; | 152 | struct ceph_mon_request_header monhdr; |
148 | struct ceph_fsid fsid; | 153 | struct ceph_fsid fsid; |
149 | } __attribute__ ((packed)); | 154 | } __attribute__ ((packed)); |
150 | 155 | ||
151 | struct ceph_client_mount { | 156 | struct ceph_client_mount { |
152 | __le64 have_version; | 157 | struct ceph_mon_request_header monhdr; |
153 | } __attribute__ ((packed)); | 158 | } __attribute__ ((packed)); |
154 | 159 | ||
155 | struct ceph_mon_subscribe_item { | 160 | struct ceph_mon_subscribe_item { |
156 | __le64 have; | 161 | __le64 have_version; __le64 have; |
157 | __u8 onetime; | 162 | __u8 onetime; |
158 | } __attribute__ ((packed)); | 163 | } __attribute__ ((packed)); |
159 | 164 | ||
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c index 63f7f1359385..b48abc0b3be7 100644 --- a/fs/ceph/messenger.c +++ b/fs/ceph/messenger.c | |||
@@ -857,7 +857,7 @@ out: | |||
857 | static int verify_hello(struct ceph_connection *con) | 857 | static int verify_hello(struct ceph_connection *con) |
858 | { | 858 | { |
859 | if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) { | 859 | if (memcmp(con->in_banner, CEPH_BANNER, strlen(CEPH_BANNER))) { |
860 | pr_err("connect to/from %s has bad banner\n", | 860 | pr_err("connect to %s got bad banner\n", |
861 | pr_addr(&con->peer_addr.in_addr)); | 861 | pr_addr(&con->peer_addr.in_addr)); |
862 | con->error_msg = "protocol error, bad banner"; | 862 | con->error_msg = "protocol error, bad banner"; |
863 | return -1; | 863 | return -1; |
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index 9c34df17fa4b..dc698caccc42 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -273,7 +273,9 @@ static void __request_mount(struct ceph_mon_client *monc) | |||
273 | if (IS_ERR(msg)) | 273 | if (IS_ERR(msg)) |
274 | return; | 274 | return; |
275 | h = msg->front.iov_base; | 275 | h = msg->front.iov_base; |
276 | h->have_version = 0; | 276 | h->monhdr.have_version = 0; |
277 | h->monhdr.session_mon = cpu_to_le16(-1); | ||
278 | h->monhdr.session_mon_tid = 0; | ||
277 | ceph_con_send(monc->con, msg); | 279 | ceph_con_send(monc->con, msg); |
278 | } | 280 | } |
279 | 281 | ||
@@ -422,7 +424,9 @@ static int send_statfs(struct ceph_mon_client *monc, | |||
422 | return PTR_ERR(msg); | 424 | return PTR_ERR(msg); |
423 | req->request = msg; | 425 | req->request = msg; |
424 | h = msg->front.iov_base; | 426 | h = msg->front.iov_base; |
425 | h->have_version = 0; | 427 | h->monhdr.have_version = 0; |
428 | h->monhdr.session_mon = cpu_to_le16(-1); | ||
429 | h->monhdr.session_mon_tid = 0; | ||
426 | h->fsid = monc->monmap->fsid; | 430 | h->fsid = monc->monmap->fsid; |
427 | h->tid = cpu_to_le64(req->tid); | 431 | h->tid = cpu_to_le64(req->tid); |
428 | ceph_con_send(monc->con, msg); | 432 | ceph_con_send(monc->con, msg); |