diff options
author | John Spray <john.spray@redhat.com> | 2014-10-30 13:15:26 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@redhat.com> | 2014-12-17 12:09:51 -0500 |
commit | 7cfa0313d0dc52e4da9f196f8ad5bfdf266fc1fb (patch) | |
tree | 528faa6aa740a07deb3e0ecabc8202dc7a9c815d /fs | |
parent | d4e1a4e0db439209672f9803f9f23b0123fb09aa (diff) |
ceph: message versioning fixes
There were two places we were assigning version in host byte order
instead of network byte order.
Also in MSG_CLIENT_SESSION we weren't setting compat_version in the
header to reflect continued compatability with older MDSs.
Fixes: http://tracker.ceph.com/issues/9945
Signed-off-by: John Spray <john.spray@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/mds_client.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 9f00853f6d42..387a48993d34 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -860,8 +860,11 @@ static struct ceph_msg *create_session_open_msg(struct ceph_mds_client *mdsc, u6 | |||
860 | /* | 860 | /* |
861 | * Serialize client metadata into waiting buffer space, using | 861 | * Serialize client metadata into waiting buffer space, using |
862 | * the format that userspace expects for map<string, string> | 862 | * the format that userspace expects for map<string, string> |
863 | * | ||
864 | * ClientSession messages with metadata are v2 | ||
863 | */ | 865 | */ |
864 | msg->hdr.version = 2; /* ClientSession messages with metadata are v2 */ | 866 | msg->hdr.version = cpu_to_le16(2); |
867 | msg->hdr.compat_version = cpu_to_le16(1); | ||
865 | 868 | ||
866 | /* The write pointer, following the session_head structure */ | 869 | /* The write pointer, following the session_head structure */ |
867 | p = msg->front.iov_base + sizeof(*h); | 870 | p = msg->front.iov_base + sizeof(*h); |
@@ -1872,7 +1875,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc, | |||
1872 | goto out_free2; | 1875 | goto out_free2; |
1873 | } | 1876 | } |
1874 | 1877 | ||
1875 | msg->hdr.version = 2; | 1878 | msg->hdr.version = cpu_to_le16(2); |
1876 | msg->hdr.tid = cpu_to_le64(req->r_tid); | 1879 | msg->hdr.tid = cpu_to_le64(req->r_tid); |
1877 | 1880 | ||
1878 | head = msg->front.iov_base; | 1881 | head = msg->front.iov_base; |