From: Lars Ellenberg Date: Tue, 19 Oct 2010 10:08:13 +0000 (+0200) Subject: drbd: rate limit an error message X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fb2c7a10eec051317ff091b2cb2d73c5ecd98c19;p=linux-beck.git drbd: rate limit an error message If we don't rate limit it, and you happen to log err level messages via serial console, an IO error on a disconnected Primary may cause serious unresponsiveness. 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 d26b213dbf15..31d04b17c45f 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -813,7 +813,8 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio) mdev->state.conn >= C_CONNECTED)); if (!(local || remote) && !is_susp(mdev->state)) { - dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); + if (__ratelimit(&drbd_ratelimit_state)) + dev_err(DEV, "IO ERROR: neither local nor remote disk\n"); goto fail_free_complete; }