hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/ceph/osd_client.c
....@@ -3330,17 +3330,24 @@
33303330 int ret;
33313331
33323332 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);
33343334 return ret ?: lreq->reg_commit_error;
33353335 }
33363336
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)
33383339 {
3339
- int ret;
3340
+ long left;
33403341
33413342 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;
33443351 }
33453352
33463353 /*
....@@ -4888,7 +4895,8 @@
48884895 linger_submit(lreq);
48894896 ret = linger_reg_commit_wait(lreq);
48904897 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));
48924900 else
48934901 dout("lreq %p failed to initiate notify %d\n", lreq, ret);
48944902