All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: linux-kernel@vger.kernel.org
Cc: Boaz Harrosh <bharrosh@panasas.com>,
	James Bottomley <James.Bottomley@SteelEye.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [patch] scsi: fix crash in gdth_timeout()
Date: Mon, 15 Oct 2007 18:55:34 +0200	[thread overview]
Message-ID: <20071015165534.GA17833@elte.hu> (raw)


the patch below fixes a bootup-crash bug merged via today's SCSI git 
merge:

 commit df3d80f5a5c74168be42788364d13cf6c83c7b9c
 Merge: 3d06f7a... c8e91b0...
 Author: Linus Torvalds <torvalds@woody.linux-foundation.org>
 Date:   Mon Oct 15 08:19:33 2007 -0700

     Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

--------------------->
Subject: scsi: fix crash in gdth_timeout()
From: Ingo Molnar <mingo@elte.hu>

fix the following bootup crash in gdth_timeout():

[   40.739625] BUG: spinlock bad magic on CPU#1, swapper/1
[   40.744822]  lock: 788a6e40, .magic: 784d8cec, .owner: <none>/-1, .owner_cpu: 2018346022
[   40.752881]  [<78104f2c>] show_trace_log_lvl+0x1a/0x2f
[   40.757994]  [<781058d1>] show_trace+0x12/0x14
[   40.762414]  [<781058e9>] dump_stack+0x16/0x18
[   40.766833]  [<782f1683>] spin_bug+0xa1/0xa9
[   40.771079]  [<782f17b0>] _raw_spin_lock+0x1e/0xe4
[   40.775846]  [<78643f9f>] _spin_lock_irqsave+0x53/0x64
[   40.781461]  [<784b224a>] gdth_timeout+0x1c/0xa6
[   40.786054]  [<7812632f>] run_timer_softirq+0x142/0x1a4
[   40.791254]  [<78123fb8>] __do_softirq+0x7b/0xf1
[   40.795847]  [<78105fb8>] do_softirq+0x61/0xc7
[   40.800267]  =======================

the bug is that list_first_entry() assumes a non-empty list.

A further problem is probably that the GDTH timer is not stopped by a
failed GDTH probe?

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/scsi/gdth.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux/drivers/scsi/gdth.c
===================================================================
--- linux.orig/drivers/scsi/gdth.c
+++ linux/drivers/scsi/gdth.c
@@ -3793,6 +3793,9 @@ static void gdth_timeout(ulong data)
     gdth_ha_str *ha;
     ulong flags;
 
+    if (list_empty(&gdth_instances))
+	    return;
+
     ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
     spin_lock_irqsave(&ha->smp_lock, flags);
 

             reply	other threads:[~2007-10-15 16:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 16:55 Ingo Molnar [this message]
2007-10-15 17:08 ` [patch] scsi: fix crash in gdth_timeout() Linus Torvalds
2007-10-15 17:57   ` Jeff Garzik
2007-10-15 18:43     ` Boaz Harrosh
2007-10-15 19:27       ` Ingo Molnar
2007-10-15 19:38         ` Linus Torvalds
2007-10-15 20:08           ` Alan Cox
2007-10-15 20:15             ` Linus Torvalds
2007-10-15 22:23           ` Ingo Molnar
2007-10-15 19:24   ` Ingo Molnar
2007-10-15 21:55   ` James Bottomley

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=20071015165534.GA17833@elte.hu \
    --to=mingo@elte.hu \
    --cc=James.Bottomley@SteelEye.com \
    --cc=bharrosh@panasas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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.