aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-22 14:24:33 -0500
committerSage Weil <sage@newdream.net>2009-12-23 11:17:22 -0500
commit6df058c025ce343052c5516b1d8a9a7e73cddd64 (patch)
tree58230bd258f71c2c3adf56a55d11ed39f404d12a /fs/ceph/mon_client.c
parent0cf90ab5b075821940873e73cdbfeb8edc3dabe8 (diff)
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,
349 349
350 if (msg->front.iov_len != sizeof(*reply)) 350 if (msg->front.iov_len != sizeof(*reply))
351 goto bad; 351 goto bad;
352 tid = le64_to_cpu(reply->tid); 352 tid = le64_to_cpu(msg->hdr.tid);
353 dout("handle_statfs_reply %p tid %llu\n", msg, tid); 353 dout("handle_statfs_reply %p tid %llu\n", msg, tid);
354 354
355 mutex_lock(&monc->mutex); 355 mutex_lock(&monc->mutex);
@@ -382,12 +382,12 @@ static int send_statfs(struct ceph_mon_client *monc,
382 if (IS_ERR(msg)) 382 if (IS_ERR(msg))
383 return PTR_ERR(msg); 383 return PTR_ERR(msg);
384 req->request = msg; 384 req->request = msg;
385 msg->hdr.tid = cpu_to_le64(req->tid);
385 h = msg->front.iov_base; 386 h = msg->front.iov_base;
386 h->monhdr.have_version = 0; 387 h->monhdr.have_version = 0;
387 h->monhdr.session_mon = cpu_to_le16(-1); 388 h->monhdr.session_mon = cpu_to_le16(-1);
388 h->monhdr.session_mon_tid = 0; 389 h->monhdr.session_mon_tid = 0;
389 h->fsid = monc->monmap->fsid; 390 h->fsid = monc->monmap->fsid;
390 h->tid = cpu_to_le64(req->tid);
391 ceph_con_send(monc->con, msg); 391 ceph_con_send(monc->con, msg);
392 return 0; 392 return 0;
393} 393}