drbd: rate limit an error message
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 19 Oct 2010 10:08:13 +0000 (12:08 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 22 Oct 2010 13:53:10 +0000 (15:53 +0200)
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 <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_req.c

index d26b213..31d04b1 100644 (file)
@@ -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;
        }