From: Pete Wyckoff <pw@osc.edu>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
linux-scsi@vger.kernel.org, Erez Zilber <erezz@voltaire.com>
Subject: Re: [BUG 1/3] bsg queue oops with iscsi logout
Date: Fri, 14 Mar 2008 20:45:23 -0400 [thread overview]
Message-ID: <20080315004523.GA18260@osc.edu> (raw)
In-Reply-To: <47D61A73.3000803@cs.wisc.edu>
michaelc@cs.wisc.edu wrote on Tue, 11 Mar 2008 00:36 -0500:
> Actually one of the problems looks a little different than some of the
> problems hit with sg and are caused because we remove the bsg device too
> soon. I think we want to wait until all the references from the
> commands/requests are released. The attached patch (untested) moves the bsg
> unreg call to the scsi device release fn.
> Delay bsg unregistration, because we want to wait until all the request/cmds
> have released their reference.
>
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index ed83cdb..b9b09a7 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -294,6 +294,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
> }
>
> if (sdev->request_queue) {
> + bsg_unregister_queue(sdev->request_queue);
> sdev->request_queue->queuedata = NULL;
> /* user context needed to free queue */
> scsi_free_queue(sdev->request_queue);
> @@ -857,7 +858,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
> if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
> return;
>
> - bsg_unregister_queue(sdev->request_queue);
> class_device_unregister(&sdev->sdev_classdev);
> transport_remove_device(dev);
> device_del(dev);
This definitely avoids the hang in [BUG 3/3]. Instead I get the
useful console message:
scsi 4:0:0:1: rejecting I/O to dead device
My tested-by for that. But it leaves a bit of a mess in sysfs.
Apparently udev did not get the message that these devs went away.
ib30$ ll /sys/class/scsi_device/
total 0
drwxr-xr-x 3 root root 0 Mar 14 20:04 ./
drwxr-xr-x 28 root root 0 Mar 14 20:02 ../
drwxr-xr-x 2 root root 0 Mar 14 20:02 2:0:0:0/
ib30$ ll /dev/bsg/
total 0
drwxr-xr-x 2 root root 100 Mar 14 20:03 ./
drwxr-xr-x 12 root root 3020 Mar 14 20:04 ../
crw-rw-rw- 1 root root 254, 0 Mar 14 20:02 2:0:0:0
crw-rw-rw- 1 root root 254, 1 Mar 14 20:03 4:0:0:0
crw-rw-rw- 1 root root 254, 2 Mar 14 20:03 4:0:0:1
I do have a special udev rule to explain why the devs look like
this:
ACTION=="add", SUBSYSTEM=="bsg", NAME="bsg/%k", MODE="0666", OPTIONS="last_rule"
but that doesn't explain why they're still in /dev.
-- Pete
next prev parent reply other threads:[~2008-03-15 0:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-09 16:53 [BUG 1/3] bsg queue oops with iscsi logout Pete Wyckoff
2008-03-09 16:54 ` [BUG 2/3] bsg null sdev " Pete Wyckoff
2008-03-09 16:55 ` [BUG 3/3] bsg mutex hang " Pete Wyckoff
2008-03-10 17:57 ` [BUG 1/3] bsg queue oops " Mike Christie
2008-03-11 5:36 ` Mike Christie
2008-03-11 22:46 ` FUJITA Tomonori
2008-03-15 0:45 ` Pete Wyckoff [this message]
2008-03-22 16:06 ` Serious regression caused by fix for " James Bottomley
2008-03-24 9:23 ` FUJITA Tomonori
2008-03-26 14:22 ` FUJITA Tomonori
2008-03-26 14:36 ` James Bottomley
2008-03-26 14:59 ` FUJITA Tomonori
2008-03-27 1:32 ` Mike Christie
2008-03-27 11:11 ` FUJITA Tomonori
2008-03-27 20:46 ` Mike Christie
2008-03-27 1:51 ` Mike Christie
2008-03-27 2:18 ` Mike Christie
2008-03-27 11:11 ` FUJITA Tomonori
2008-03-27 11:11 ` FUJITA Tomonori
2008-03-27 12:18 ` FUJITA Tomonori
2008-03-30 17:39 ` James Bottomley
2008-03-31 0:20 ` FUJITA Tomonori
2008-04-02 18:41 ` Boaz Harrosh
2008-04-02 21:00 ` FUJITA Tomonori
2008-04-03 7:58 ` Boaz Harrosh
2008-03-27 1:59 ` Mike Christie
2008-03-27 0:25 ` Mike Christie
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=20080315004523.GA18260@osc.edu \
--to=pw@osc.edu \
--cc=erezz@voltaire.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
/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.