ceph: cleanup aborted requests when re-sending requests.
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 26 Sep 2013 06:25:36 +0000 (14:25 +0800)
committerSage Weil <sage@inktank.com>
Sat, 23 Nov 2013 19:01:04 +0000 (11:01 -0800)
Aborted requests usually get cleared when the reply is received.
If MDS crashes, no reply will be received. So we need to cleanup
aborted requests when re-sending requests.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
fs/ceph/mds_client.c

index 6d953ab0ac06c08463c6134639d658a7ce90f304..8ef79266d0645651b03465c72314bb6129f95d56 100644 (file)
@@ -1872,8 +1872,11 @@ static int __do_request(struct ceph_mds_client *mdsc,
        int mds = -1;
        int err = -EAGAIN;
 
-       if (req->r_err || req->r_got_result)
+       if (req->r_err || req->r_got_result) {
+               if (req->r_aborted)
+                       __unregister_request(mdsc, req);
                goto out;
+       }
 
        if (req->r_timeout &&
            time_after_eq(jiffies, req->r_started + req->r_timeout)) {