From: James Bottomley <James.Bottomley@steeleye.com>
To: Matt Domsch <Matt_Domsch@Dell.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [RFC] 2.6.0 EDD enhancements
Date: 19 Dec 2003 15:23:21 -0500 [thread overview]
Message-ID: <1071865401.1943.31.camel@mulgrave> (raw)
In-Reply-To: <20031219130129.B6530@lists.us.dell.com>
On Fri, 2003-12-19 at 14:01, Matt Domsch wrote:
> @@ -639,11 +629,11 @@
> pci_dev = edd_get_pci_dev(edev);
> if (pci_dev) {
> struct scsi_device * sdev = edd_find_matching_scsi_device(edev);
> - if (sdev && get_device(&sdev->sdev_driverfs_dev)) {
> + if (sdev && get_device(&sdev->sdev_gendev)) {
> rc = sysfs_create_link(&edev->kobj,
> - &sdev->sdev_driverfs_dev.kobj,
> + &sdev->sdev_gendev.kobj,
> "disc");
> - put_device(&sdev->sdev_driverfs_dev);
> + put_device(&sdev->sdev_gendev);
This is a bit nasty...you're assuming a lot of hidden knowledge about
the layout of sysfs objects in scsi_device in this code.
The current(*) way you should be doing this is to use scsi_device_get()
in your edd_match_scsi_dev() and do a scsi_device_put() after creating
the link...that should be hotplug robust.
(*) since SCSI hotplug is a work in progress, this may change...
James
next prev parent reply other threads:[~2003-12-19 20:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-19 18:57 [RFC] 2.6.0 EDD enhancements Matt Domsch
2003-12-19 19:01 ` Matt Domsch
2003-12-19 19:01 ` Matt Domsch
2003-12-19 20:23 ` James Bottomley [this message]
2003-12-19 20:37 ` Matt Domsch
2003-12-19 21:03 ` James Bottomley
2003-12-28 20:08 ` Christoph Hellwig
2003-12-29 20:05 ` Matt Domsch
2003-12-19 19:01 ` Matt Domsch
2003-12-19 19:03 ` Randy.Dunlap
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=1071865401.1943.31.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=Matt_Domsch@Dell.com \
--cc=linux-kernel@vger.kernel.org \
--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