ceph: make mds ops interruptible
authorSage Weil <sage@newdream.net>
Tue, 15 Dec 2009 18:27:48 +0000 (10:27 -0800)
committerSage Weil <sage@newdream.net>
Tue, 22 Dec 2009 00:39:53 +0000 (16:39 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/mds_client.c

index 29a93fe35f853214c5b26c388a76c96500f1273f..d7cecc3366daf555b8cab465a67f81834cc1b09b 100644 (file)
@@ -1597,14 +1597,17 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
        if (!req->r_reply) {
                mutex_unlock(&mdsc->mutex);
                if (req->r_timeout) {
-                       err = wait_for_completion_timeout(&req->r_completion,
-                                                         req->r_timeout);
-                       if (err > 0)
-                               err = 0;
-                       else if (err == 0)
+                       err = (long)wait_for_completion_interruptible_timeout(
+                               &req->r_completion, req->r_timeout);
+                       if (err == 0)
                                req->r_reply = ERR_PTR(-EIO);
+                       else if (err < 0)
+                               req->r_reply = ERR_PTR(err);
                } else {
-                       wait_for_completion(&req->r_completion);
+                        err = wait_for_completion_interruptible(
+                                &req->r_completion);
+                        if (err)
+                                req->r_reply = ERR_PTR(err);
                }
                mutex_lock(&mdsc->mutex);
        }