Skip to content

Commit

Permalink
ceph: make mds ops interruptible
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Dec 22, 2009
1 parent cf3e5c4 commit e2885f0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e2885f0

Please sign in to comment.