mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vasily Averin <vvs@virtuozzo.com>
To: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Jeff Layton <jlayton@poochiereds.net>,
	Scott Mayhew <smayhew@redhat.com>
Subject: [PATCH 2/2] notifiers: double register detection
Date: Wed, 21 Sep 2016 15:33:11 +0300	[thread overview]
Message-ID: <105a9bce-5539-73f1-2683-e52dba870c04@virtuozzo.com> (raw)

WARN_ON should help to detect double register of the same notifiers

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 kernel/notifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/notifier.c b/kernel/notifier.c
index fd2c9ac..e02b2f0 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -22,6 +22,7 @@ static int notifier_chain_register(struct notifier_block **nl,
 		struct notifier_block *n)
 {
 	while ((*nl) != NULL) {
+		WARN_ON((*nl) == n);
 		if (n->priority > (*nl)->priority)
 			break;
 		nl = &((*nl)->next);
-- 
1.9.1

             reply	other threads:[~2016-09-21 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 12:33 Vasily Averin [this message]
2016-10-27 10:44 ` Vasily Averin

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=105a9bce-5539-73f1-2683-e52dba870c04@virtuozzo.com \
    --to=vvs@virtuozzo.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=smayhew@redhat.com \
    /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®