mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org, nbd-general@lists.sourceforge.net,
	kernel@pengutronix.de,
	Dan Streetman <dan.streetman@canonical.com>,
	Markus Pargmann <mpa@pengutronix.de>
Subject: [PATCH 6/7] nbd: ratelimit error msgs after socket close
Date: Sun, 21 Feb 2016 15:01:26 +0100	[thread overview]
Message-ID: <1456063287-28941-7-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1456063287-28941-1-git-send-email-mpa@pengutronix.de>

From: Dan Streetman <dan.streetman@canonical.com>

Make the "Attempted send on closed socket" error messages generated in
nbd_request_handler() ratelimited.

When the nbd socket is shutdown, the nbd_request_handler() function emits
an error message for every request remaining in its queue.  If the queue
is large, this will spam a large amount of messages to the log.  There's
no need for a separate error message for each request, so this patch
ratelimits it.

In the specific case this was found, the system was virtual and the error
messages were logged to the serial port, which overwhelmed it.

Fixes: 4d48a542b427 ("nbd: fix I/O hang on disconnected nbds")
Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 drivers/block/nbd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index b67500d5b338..4c5d94146aa3 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -580,8 +580,8 @@ static void nbd_request_handler(struct request_queue *q)
 			req, req->cmd_type);
 
 		if (unlikely(!nbd->sock)) {
-			dev_err(disk_to_dev(nbd->disk),
-				"Attempted send on closed socket\n");
+			dev_err_ratelimited(disk_to_dev(nbd->disk),
+					    "Attempted send on closed socket\n");
 			req->errors++;
 			nbd_end_request(nbd, req);
 			spin_lock_irq(q->queue_lock);
-- 
2.7.0

  parent reply	other threads:[~2016-02-21 17:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-21 14:01 [PULL] NBD for 4.6 Markus Pargmann
2016-02-21 14:01 ` [PATCH 1/7] nbd: Fix debugfs error handling Markus Pargmann
2016-02-21 14:01 ` [PATCH 2/7] nbd: Remove signal usage Markus Pargmann
2016-02-21 14:01 ` [PATCH 3/7] nbd: Timeouts are not user requested disconnects Markus Pargmann
2016-02-21 14:01 ` [PATCH 4/7] nbd: Cleanup reset of nbd and bdev after a disconnect Markus Pargmann
2016-02-21 14:01 ` [PATCH 5/7] nbd: Move flag parsing to a function Markus Pargmann
2016-02-21 14:01 ` Markus Pargmann [this message]
2016-02-21 14:01 ` [PATCH 7/7] nbd: Create size change events for userspace Markus Pargmann
2016-03-03  7:48 ` [PULL] NBD for 4.6 Markus Pargmann
2016-03-03 13:53   ` Jens Axboe
2016-03-03 15:04     ` Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456063287-28941-7-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=axboe@kernel.dk \
    --cc=dan.streetman@canonical.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd-general@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®