diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-12 11:08:26 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-14 08:35:58 -0400 |
commit | 11b58e73a3a3d1bbb582370d59f9b2c4d0136b42 (patch) | |
tree | 9ca5b48e368da91f6cc1888440b6ea9ffe9a7e3f /drivers/block/drbd/drbd_req.c | |
parent | 2a80699f807885d501f08a7006f6a56c1c937a6e (diff) |
drbd: factored tl_restart() out of tl_clear().
If IO was frozen for a temporal network outage, resend the
content of the transfer-log into the newly established connection.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index d9df1a1c40b9..39c2cc3614e4 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -634,6 +634,20 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, | |||
634 | /* else: done by handed_over_to_network */ | 634 | /* else: done by handed_over_to_network */ |
635 | break; | 635 | break; |
636 | 636 | ||
637 | case resend: | ||
638 | /* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK | ||
639 | before the connection loss; only P_BARRIER_ACK was missing. | ||
640 | Trowing them out of the TL here by pretending we got a BARRIER_ACK | ||
641 | TODO: Either resync them, or ensure peer was not rebooted. */ | ||
642 | if (!(req->rq_state & RQ_NET_OK)) { | ||
643 | if (req->w.cb) { | ||
644 | drbd_queue_work(&mdev->data.work, &req->w); | ||
645 | rv = req->rq_state & RQ_WRITE ? MR_WRITE : MR_READ; | ||
646 | } | ||
647 | break; | ||
648 | } | ||
649 | /* else, fall through to barrier_acked */ | ||
650 | |||
637 | case barrier_acked: | 651 | case barrier_acked: |
638 | if (!(req->rq_state & RQ_WRITE)) | 652 | if (!(req->rq_state & RQ_WRITE)) |
639 | break; | 653 | break; |