summaryrefslogtreecommitdiff
path: root/fs/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-22 22:24:33 +0300
committerSage Weil <sage@newdream.net>2009-12-23 19:17:22 +0300
commit6df058c025ce343052c5516b1d8a9a7e73cddd64 (patch)
tree58230bd258f71c2c3adf56a55d11ed39f404d12a /fs/ceph/mon_client.c
parent0cf90ab5b075821940873e73cdbfeb8edc3dabe8 (diff)
downloadlinux-6df058c025ce343052c5516b1d8a9a7e73cddd64.tar.xz
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/mon_client.c')
-rw-r--r--fs/ceph/mon_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 775a9c029c51..bb94006fc686 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -349,7 +349,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc,
if (msg->front.iov_len != sizeof(*reply))
goto bad;
- tid = le64_to_cpu(reply->tid);
+ tid = le64_to_cpu(msg->hdr.tid);
dout("handle_statfs_reply %p tid %llu\n", msg, tid);
mutex_lock(&monc->mutex);
@@ -382,12 +382,12 @@ static int send_statfs(struct ceph_mon_client *monc,
if (IS_ERR(msg))
return PTR_ERR(msg);
req->request = msg;
+ msg->hdr.tid = cpu_to_le64(req->tid);
h = msg->front.iov_base;
h->monhdr.have_version = 0;
h->monhdr.session_mon = cpu_to_le16(-1);
h->monhdr.session_mon_tid = 0;
h->fsid = monc->monmap->fsid;
- h->tid = cpu_to_le64(req->tid);
ceph_con_send(monc->con, msg);
return 0;
}