]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix up replay after mds recovery
authorSage Weil <sage@newdream.net>
Sat, 7 Mar 2009 00:26:05 +0000 (16:26 -0800)
committerSage Weil <sage@newdream.net>
Sat, 7 Mar 2009 00:27:19 +0000 (16:27 -0800)
Do not kick unsafe requests in kick_requests (and in particular, do not
drop the session refs).

Set retry_attempt to MDS_REQUEST_REPLAY to indicate which requests are
replays.

src/kernel/mds_client.c

index 43ff79ef14d25afc6962b9bb5396fce487104473..c18ba009bc8f89b9a3b4a573e0c474ca04a7a51a 100644 (file)
@@ -1081,7 +1081,10 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
 
        rhead = msg->front.iov_base;
        rhead->tid = cpu_to_le64(req->r_tid);
-       rhead->retry_attempt = cpu_to_le32(req->r_attempts - 1);
+       if (req->r_got_safe)
+               rhead->retry_attempt = cpu_to_le32(CEPH_MDS_REQUEST_REPLAY);
+       else
+               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);
 
@@ -1194,6 +1197,8 @@ static void kick_requests(struct ceph_mds_client *mdsc, int mds, int all)
                        break;
                nexttid = reqs[got-1]->r_tid + 1;
                for (i = 0; i < got; i++) {
+                       if (reqs[i]->r_got_unsafe)
+                               continue;
                        if (((reqs[i]->r_session &&
                              reqs[i]->r_session->s_mds == mds) ||
                             (all && reqs[i]->r_fwd_session &&