]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ceph: message versioning fixes
authorJohn Spray <john.spray@redhat.com>
Thu, 30 Oct 2014 17:15:26 +0000 (17:15 +0000)
committerIlya Dryomov <idryomov@redhat.com>
Wed, 17 Dec 2014 17:09:51 +0000 (20:09 +0300)
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>
fs/ceph/mds_client.c

index 9f00853f6d42b9394058ee2f316c972a1830fe62..387a48993d34468b6a3e745ad4d59c3c7d86efb9 100644 (file)
@@ -860,8 +860,11 @@ static struct ceph_msg *create_session_open_msg(struct ceph_mds_client *mdsc, u6
        /*
         * Serialize client metadata into waiting buffer space, using
         * the format that userspace expects for map<string, string>
+        *
+        * ClientSession messages with metadata are v2
         */
-       msg->hdr.version = 2;  /* ClientSession messages with metadata are v2 */
+       msg->hdr.version = cpu_to_le16(2);
+       msg->hdr.compat_version = cpu_to_le16(1);
 
        /* The write pointer, following the session_head structure */
        p = msg->front.iov_base + sizeof(*h);
@@ -1872,7 +1875,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
                goto out_free2;
        }
 
-       msg->hdr.version = 2;
+       msg->hdr.version = cpu_to_le16(2);
        msg->hdr.tid = cpu_to_le64(req->r_tid);
 
        head = msg->front.iov_base;