public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: "goggin, edward" <egoggin@emc.com>
Cc: 'Andrew Morton' <akpm@osdl.org>,
	Masanari Iida <standby24x7@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-usb-devel@lists.sourceforge.net,
	linux-scsi@vger.kernel.org
Subject: RE: oops with USB Storage on 2.6.14
Date: Tue, 08 Nov 2005 12:01:45 -0500	[thread overview]
Message-ID: <1131469305.3270.21.camel@mulgrave> (raw)
In-Reply-To: <C2EEB4E538D3DC48BF57F391F422779321ADBA@srmanning.eng.emc.com>

On Tue, 2005-11-08 at 11:24 -0500, goggin, edward wrote:
> ! 	struct scsi_device *sdev = cmd->device;
> ! 	struct request_queue *q = sdev->request_queue;
> ! 
> ! 	// need to hold a reference on the device before we let go of the
> cmd
> ! 	if (scsi_device_get(sdev)) {
> ! 		scsi_put_command(cmd);
> ! 		return;		// maybe sdev_state == SDEV_CANCEL, SDEV_DEL
> ! 	}
>   
>   	scsi_put_command(cmd);
>   	scsi_run_queue(q);
> + 
> + 	// ok to remove device now
> + 	scsi_device_put(sdev);

This is the right idea, I think, but not necessarily the right fix.
scsi_device_get() will fail if the device is going offline, but we would
still need to run the queues.

try this sequence instead:

get_device(&sdev->sdev_gendev);
scsi_put_command(cmd);
scsi_run_queue(q);
put_device(&sdev->sdev_gendev);

James




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

  parent reply	other threads:[~2005-11-08 17:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 16:24 oops with USB Storage on 2.6.14 goggin, edward
2005-11-08 16:38 ` Rolf Eike Beer
2005-11-08 17:01 ` James Bottomley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-12-07  3:29 goggin, edward
2005-11-08 20:02 goggin, edward
2005-11-08 21:08 ` James Bottomley
2005-11-08 21:33   ` Patrick Mansfield
2005-11-08 21:45     ` James Bottomley
2005-11-08 18:02 goggin, edward
     [not found] <38bdcd1f0510290511t65bb16cfkfd1e84fb301424f9@mail.gmail.com>
2005-10-30 19:03 ` Andrew Morton
     [not found]   ` <38bdcd1f0510301641l3a211e41n3c571a98eef6185e@mail.gmail.com>
2005-10-31  1:02     ` Andrew Morton
2005-11-08  4:40 ` Andrew Morton
2005-11-08 15:01   ` Masanari Iida

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=1131469305.3270.21.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=egoggin@emc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=standby24x7@gmail.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