From: Sage Weil Date: Fri, 19 Dec 2008 22:27:00 +0000 (-0800) Subject: kclient: update num_fwd in client requests X-Git-Tag: v0.6~1^2~217 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f06b732600a6ba352a44d660bd3ac33af7a6450;p=ceph.git kclient: update num_fwd in client requests We were keeping our local copy, but not updating the message sent. Also fix buggy maybe_dup behavior (dup, then set rhead pointer)! --- diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index fd3d257a9c75..2cb901261106 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -1222,7 +1222,7 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, struct ceph_mds_request *req) { struct ceph_mds_session *session = NULL; - struct ceph_mds_request_head *rhead = req->r_request->front.iov_base; + struct ceph_mds_request_head *rhead; int err; int mds = -1; @@ -1278,19 +1278,21 @@ retry: if (req->r_request_started == 0) /* note request start time */ req->r_request_started = jiffies; + /* if there are other references on this message, e.g., if we are + * told to forward it and the previous copy is still in flight, dup + * it. */ + req->r_request = ceph_msg_maybe_dup(req->r_request); + + rhead = req->r_request->front.iov_base; rhead->retry_attempt = cpu_to_le32(req->r_attempts - 1); rhead->oldest_client_tid = cpu_to_le64(__get_oldest_tid(mdsc)); + rhead->num_fwd = cpu_to_le32(req->r_num_fwd); /* send and wait */ mutex_unlock(&mdsc->mutex); dout(10, "do_request %p %lld r_expected_cap=%p\n", req, req->r_tid, req->r_expected_cap); - /* if there are other references on this message, e.g., if we are - * told to forward it and the previous copy is still in flight, dup - * it. */ - req->r_request = ceph_msg_maybe_dup(req->r_request); - ceph_msg_get(req->r_request); ceph_send_msg_mds(mdsc, req->r_request, mds);