public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Douglas Gilbert <dougg@torque.net>
Cc: linux-scsi@vger.kernel.org
Subject: Re: sym53c8xx_2 oops in lk 2.5.69-bk14
Date: Wed, 21 May 2003 09:19:18 -0700	[thread overview]
Message-ID: <20030521091918.A21010@beaverton.ibm.com> (raw)
In-Reply-To: <3ECAFCC1.40402@torque.net>; from dougg@torque.net on Wed, May 21, 2003 at 02:12:49PM +1000

On Wed, May 21, 2003 at 02:12:49PM +1000, Douglas Gilbert wrote:
> This oops in the sym53c8xx may have been recently
> introduced since I run rescan-scsi-bus.sh reasonably
> often. It locked my system solid, scrolled the useful
> part of the oops off the screen and put nothing in
> the log. Handwritten notes:

The scsi_host_hn_get is not doing a scsi_host_get, so any scsi_host_put
that follows can break things - for example causing the scsi_host to
disappear out from under us. See the scsi_proc.c usage.

Christoph's "give ->proc_info a struct Scsi_Host * parameter" patch got
rid of a lot of them (and is in scsi-miscs-2.5), but not in scsi_proc.c.

Looks like scsi_host_hn_get should always call scsi_host_get, but
scsi_find_host_by_num really has to change to use driver model iterators
(so its locking protection matches scsi_host_get), I assume this is a WIP
for Christoph or Mike but for now you could use a patch like this
(untested, on top of scsi-misc-2.5 or Christoph's changes):

===== drivers/scsi/hosts.c 1.65 vs edited =====
--- 1.65/drivers/scsi/hosts.c	Thu May 15 06:08:47 2003
+++ edited/drivers/scsi/hosts.c	Fri May 23 10:24:10 2003
@@ -534,8 +534,12 @@
  **/
 struct Scsi_Host *scsi_host_hn_get(unsigned short host_no)
 {
-	/* XXX Inc ref count */
-	return scsi_find_host_by_num(host_no);
+	struct Scsi_Host *shost;
+
+	shost = scsi_find_host_by_num(host_no);
+	if (shost)
+		scsi_host_get(shost);
+	return shost;
 }
 
 /**

-- Patrick Mansfield

  reply	other threads:[~2003-05-21 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  4:12 sym53c8xx_2 oops in lk 2.5.69-bk14 Douglas Gilbert
2003-05-21 16:19 ` Patrick Mansfield [this message]
2003-05-22  2:17   ` Douglas Gilbert

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=20030521091918.A21010@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox