All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Clements <Paul.Clements@SteelEye.com>
To: neilb@cse.unsw.edu.au
Cc: linux-raid@vger.kernel.org
Subject: [PATCH 2.6] md debug fixes
Date: Thu, 22 Jan 2004 15:59:13 -0500	[thread overview]
Message-ID: <401039A1.D82E8B8D@SteelEye.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

Hi Neil,

While running md with debug turned on, I noticed a couple of things that
could maybe use changing. 

The first change simply makes one of the debug messages a little more
useful (printing a thread's name rather than just a hex pointer value). 

The second fix is necessary to avoid an oops when md_error is called.
Because md_error is generally called when a device has failed, the
chance of the rdev parameter being NULL is fairly high. I hit this oops
several times in testing.

Patch attached, please apply.

Thanks,
Paul

[-- Attachment #2: md_error_debug_fix.diff --]
[-- Type: text/x-patch, Size: 1505 bytes --]

Index: drivers/md/md.c
===================================================================
RCS file: /home/cvs/CVSROOT/kernel/linux-2.6.0/drivers/md/md.c,v
retrieving revision 1.6
diff -p -u -r1.6 md.c
--- drivers/md/md.c	2004/01/12 20:33:10	1.6
+++ drivers/md/md.c	2004/01/22 19:00:35
@@ -2903,7 +2892,7 @@ int md_thread(void * arg)
 void md_wakeup_thread(mdk_thread_t *thread)
 {
 	if (thread) {
-		dprintk("md: waking up MD thread %p.\n", thread);
+		dprintk("md: waking up MD thread %s.\n", thread->tsk->comm);
 		set_bit(THREAD_WAKEUP, &thread->flags);
 		wake_up(&thread->wqueue);
 	}
@@ -2964,12 +2953,6 @@ void md_unregister_thread(mdk_thread_t *
 
 void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
 {
-	dprintk("md_error dev:(%d:%d), rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
-		MD_MAJOR,mdidx(mddev),
-		MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev),
-		__builtin_return_address(0),__builtin_return_address(1),
-		__builtin_return_address(2),__builtin_return_address(3));
-
 	if (!mddev) {
 		MD_BUG();
 		return;
@@ -2977,6 +2960,13 @@ void md_error(mddev_t *mddev, mdk_rdev_t
 
 	if (!rdev || rdev->faulty)
 		return;
+
+	dprintk("md_error dev:(%d:%d), rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
+		MD_MAJOR,mdidx(mddev),
+		MAJOR(rdev->bdev->bd_dev), MINOR(rdev->bdev->bd_dev),
+		__builtin_return_address(0),__builtin_return_address(1),
+		__builtin_return_address(2),__builtin_return_address(3));
+
 	if (!mddev->pers->error_handler)
 		return;
 	mddev->pers->error_handler(mddev,rdev);

             reply	other threads:[~2004-01-22 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 20:59 Paul Clements [this message]
2004-01-23  0:23 ` [PATCH 2.6] md debug fixes Neil Brown

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=401039A1.D82E8B8D@SteelEye.com \
    --to=paul.clements@steeleye.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.