]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: set osd request message front length correctly
authorSage Weil <sage@newdream.net>
Mon, 1 Mar 2010 23:26:41 +0000 (15:26 -0800)
committerSage Weil <sage@newdream.net>
Mon, 1 Mar 2010 23:30:58 +0000 (15:30 -0800)
We didn't set the front length correctly.  When messages used
the message pool we ended up with the conservative max (4 KB), and
the rest of the time the slightly less conservative estimate.  Even
though the OSD ignores the extra data, set it to the right value to avoid
sending extra data over the network.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/osd_client.c

index fa0f73703954b4f1c8a568d841155cda99ced260..104e8f14e9600fe86a6b2aabe6d0ad7ab6e34888 100644 (file)
@@ -288,6 +288,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
        }
 
        BUG_ON(p > msg->front.iov_base + msg->front.iov_len);
+       msg_size = p - msg->front.iov_base;
+       msg->front.iov_len = msg_size;
+       msg->hdr.front_len = cpu_to_le32(msg_size);
        return req;
 }