.. | .. |
---|
3330 | 3330 | int ret; |
---|
3331 | 3331 | |
---|
3332 | 3332 | dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); |
---|
3333 | | - ret = wait_for_completion_interruptible(&lreq->reg_commit_wait); |
---|
| 3333 | + ret = wait_for_completion_killable(&lreq->reg_commit_wait); |
---|
3334 | 3334 | return ret ?: lreq->reg_commit_error; |
---|
3335 | 3335 | } |
---|
3336 | 3336 | |
---|
3337 | | -static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq) |
---|
| 3337 | +static int linger_notify_finish_wait(struct ceph_osd_linger_request *lreq, |
---|
| 3338 | + unsigned long timeout) |
---|
3338 | 3339 | { |
---|
3339 | | - int ret; |
---|
| 3340 | + long left; |
---|
3340 | 3341 | |
---|
3341 | 3342 | dout("%s lreq %p linger_id %llu\n", __func__, lreq, lreq->linger_id); |
---|
3342 | | - ret = wait_for_completion_interruptible(&lreq->notify_finish_wait); |
---|
3343 | | - return ret ?: lreq->notify_finish_error; |
---|
| 3343 | + left = wait_for_completion_killable_timeout(&lreq->notify_finish_wait, |
---|
| 3344 | + ceph_timeout_jiffies(timeout)); |
---|
| 3345 | + if (left <= 0) |
---|
| 3346 | + left = left ?: -ETIMEDOUT; |
---|
| 3347 | + else |
---|
| 3348 | + left = lreq->notify_finish_error; /* completed */ |
---|
| 3349 | + |
---|
| 3350 | + return left; |
---|
3344 | 3351 | } |
---|
3345 | 3352 | |
---|
3346 | 3353 | /* |
---|
.. | .. |
---|
4888 | 4895 | linger_submit(lreq); |
---|
4889 | 4896 | ret = linger_reg_commit_wait(lreq); |
---|
4890 | 4897 | if (!ret) |
---|
4891 | | - ret = linger_notify_finish_wait(lreq); |
---|
| 4898 | + ret = linger_notify_finish_wait(lreq, |
---|
| 4899 | + msecs_to_jiffies(2 * timeout * MSEC_PER_SEC)); |
---|
4892 | 4900 | else |
---|
4893 | 4901 | dout("lreq %p failed to initiate notify %d\n", lreq, ret); |
---|
4894 | 4902 | |
---|