drbd: Use ping-timeout when waiting for missing ack packets
authorAndreas Gruenbacher <agruen@linbit.com>
Tue, 1 Mar 2011 14:40:43 +0000 (15:40 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 14 Oct 2011 14:47:51 +0000 (16:47 +0200)
When the node with the discard flag resolves write conflicts in
dual-primary mode, it may determine that its peer has sent ack packets
on the metadata socket which did not arrive, yet.  Wait for the next ack
with ping-timeout instead of a hard-coded 30 seconds.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_receiver.c

index c61bf121bd0fcad7a8fa1d80b1e5c8700e442e8c..112098bc4c8c353c028bcedebdfd30683f0bf0a1 100644 (file)
@@ -1710,11 +1710,12 @@ static int drbd_wait_peer_seq(struct drbd_conf *mdev, const u32 packet_seq)
                }
                p_seq = mdev->peer_seq;
                spin_unlock(&mdev->peer_seq_lock);
-               timeout = schedule_timeout(30*HZ);
+               timeout = mdev->tconn->net_conf->ping_timeo*HZ/10;
+               timeout = schedule_timeout(timeout);
                spin_lock(&mdev->peer_seq_lock);
                if (timeout == 0 && p_seq == mdev->peer_seq) {
                        ret = -ETIMEDOUT;
-                       dev_err(DEV, "ASSERT FAILED waited 30 seconds for sequence update, forcing reconnect\n");
+                       dev_err(DEV, "Timed out waiting for missing ack packets; disconnecting\n");
                        break;
                }
        }