From: Lars Ellenberg Date: Thu, 20 Mar 2014 13:04:35 +0000 (+0100) Subject: drbd: short-circuit in maybe_pull_ahead X-Git-Tag: v3.17-rc1~31^2~34 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0c066bc39e56a60785b32d6e43aa6659fb3793ab;p=karo-tx-linux.git drbd: short-circuit in maybe_pull_ahead If we already "pulled ahead", we can short-circuit, and avoid logging the same messages over and over again. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index f07a724998ea..3824d5c737e6 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -899,6 +899,9 @@ static void maybe_pull_ahead(struct drbd_device *device) connection->agreed_pro_version < 96) return; + if (on_congestion == OC_PULL_AHEAD && device->state.conn == C_AHEAD) + return; /* nothing to do ... */ + /* If I don't even have good local storage, we can not reasonably try * to pull ahead of the peer. We also need the local reference to make * sure device->act_log is there.