public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: linux-kernel@vger.kernel.org, rusty@rustcorp.com.au
Subject: Re: [PATCH 16/21] KGDB: This allows for KGDB to better deal with autoloaded   modules.
Date: Thu, 17 Jan 2008 14:56:18 +0100	[thread overview]
Message-ID: <478F5E82.8060300@siemens.com> (raw)
In-Reply-To: <4713B289.20204@windriver.com>

Jason Wessel wrote:
> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
> 
...
> --- linux-2.6-kgdb.orig/kernel/module.c
> +++ linux-2.6-kgdb/kernel/module.c
> @@ -65,6 +65,7 @@ extern int module_sysfs_initialized;
>   * (add/delete uses stop_machine). */
>  static DEFINE_MUTEX(module_mutex);
>  static LIST_HEAD(modules);
> +static DECLARE_MUTEX(notify_mutex);

These days, notify_mutex should better be a real mutex.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

---
 kernel/module.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Index: b/kernel/module.c
===================================================================
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -66,7 +66,7 @@ extern int module_sysfs_initialized;
  * (add/delete uses stop_machine). */
 static DEFINE_MUTEX(module_mutex);
 static LIST_HEAD(modules);
-static DECLARE_MUTEX(notify_mutex);
+static DEFINE_MUTEX(notify_mutex);
 
 static BLOCKING_NOTIFIER_HEAD(module_notify_list);
 
@@ -712,10 +712,10 @@ sys_delete_module(const char __user *nam
 	if (ret != 0)
 		goto out;
 
-	down(&notify_mutex);
+	mutex_lock(&notify_mutex);
 	blocking_notifier_call_chain(&module_notify_list, MODULE_STATE_GOING,
 								 mod);
-	up(&notify_mutex);
+	mutex_unlock(&notify_mutex);
 
 
 	/* Never wait if forced. */
@@ -730,10 +730,10 @@ sys_delete_module(const char __user *nam
 	}
 	free_module(mod);
 
-	down(&notify_mutex);
+	mutex_lock(&notify_mutex);
 	blocking_notifier_call_chain(&module_notify_list, MODULE_STATE_GONE,
 			NULL);
-	up(&notify_mutex);
+	mutex_unlock(&notify_mutex);
 
  out:
 	mutex_unlock(&module_mutex);
@@ -2182,11 +2182,11 @@ sys_init_module(void __user *umod,
 		/* Init routine failed: abort.  Try to protect us from
                    buggy refcounters. */
 		mod->state = MODULE_STATE_GOING;
-		down(&notify_mutex);
+		mutex_lock(&notify_mutex);
 		blocking_notifier_call_chain(&module_notify_list,
 				MODULE_STATE_GOING,
 				mod);
-		up(&notify_mutex);
+		mutex_unlock(&notify_mutex);
 		synchronize_sched();
 		module_put(mod);
 		mutex_lock(&module_mutex);

  reply	other threads:[~2008-01-17 13:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 18:33 [PATCH 16/21] KGDB: This allows for KGDB to better deal with autoloaded modules Jason Wessel
2008-01-17 13:56 ` Jan Kiszka [this message]
2008-01-17 14:18   ` Jason Wessel
     [not found] ` <200801180833.08185.rusty@rustcorp.com.au>
2008-01-25 22:11   ` Jason Wessel

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=478F5E82.8060300@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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