summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorSage Weil2009-12-22 20:24:33 +0100
committerSage Weil2009-12-23 17:17:22 +0100
commit6df058c025ce343052c5516b1d8a9a7e73cddd64 (patch)
tree58230bd258f71c2c3adf56a55d11ed39f404d12a /fs/ceph/mds_client.c
parentceph: more informative msgpool errors (diff)
downloadkernel-qcow2-linux-6df058c025ce343052c5516b1d8a9a7e73cddd64.tar.gz
kernel-qcow2-linux-6df058c025ce343052c5516b1d8a9a7e73cddd64.tar.xz
kernel-qcow2-linux-6df058c025ce343052c5516b1d8a9a7e73cddd64.zip
ceph: include transaction id in ceph_msg_header (protocol change)
Many (most?) message types include a transaction id. By including it in the fixed size header, we always have it available even when we are unable to allocate memory for the (larger, variable sized) message body. This will allow us to error out the appropriate request instead of (silently) dropping the reply. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 63ca3b1ad45f..ec884e2845db 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1339,6 +1339,8 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
if (IS_ERR(msg))
goto out_free2;
+ msg->hdr.tid = cpu_to_le64(req->r_tid);
+
head = msg->front.iov_base;
p = msg->front.iov_base + sizeof(*head);
end = msg->front.iov_base + msg->front.iov_len;
@@ -1431,7 +1433,6 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
req->r_request = msg;
rhead = msg->front.iov_base;
- rhead->tid = cpu_to_le64(req->r_tid);
rhead->oldest_client_tid = cpu_to_le64(__get_oldest_tid(mdsc));
if (req->r_got_unsafe)
flags |= CEPH_MDS_FLAG_REPLAY;
@@ -1664,7 +1665,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
}
/* get request, session */
- tid = le64_to_cpu(head->tid);
+ tid = le64_to_cpu(msg->hdr.tid);
mutex_lock(&mdsc->mutex);
req = __lookup_request(mdsc, tid);
if (!req) {