From: James Bottomley <James.Bottomley@SteelEye.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] fix leftover from default sdev attribute switch
Date: Wed, 26 Sep 2007 15:08:31 -0500 [thread overview]
Message-ID: <1190837311.3359.74.camel@localhost.localdomain> (raw)
In-Reply-To: <1190831520.3773.79.camel@lov.localdomain>
On Wed, 2007-09-26 at 20:32 +0200, Kay Sievers wrote:
> On Wed, 2007-09-26 at 13:23 -0500, James Bottomley wrote:
> > On Wed, 2007-09-26 at 19:54 +0200, Kay Sievers wrote:
> > > Hi James,
> > > seems we miss the following fix in the current tree.
> > >
> > > From: Kay Sievers <kay.sievers@vrfy.org>
> > > Subject: [SCSI] fix scsi_is_sdev_device() after switch to default sdev attributes
> > >
> > > Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> > > ---
> > > diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> > > index 0088c4d..8e880ef 100644
> > > --- a/drivers/scsi/scsi_sysfs.c
> > > +++ b/drivers/scsi/scsi_sysfs.c
> > > @@ -995,7 +995,7 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
> > >
> > > int scsi_is_sdev_device(const struct device *dev)
> > > {
> > > - return dev->release == scsi_device_dev_release;
> > > + return dev->type == &scsi_dev_type;
> >
> > This will make the check different from all the others in the
> > mid-layer ... is there any reason to change it?
>
> The release function moved to device_type, so the "hack" with checking
> for the release pointer at the device doesn't work anymore. With Hannes'
> patches here on the list, the target and host will get device_type too,
> and the same way of matching.
So all the other ones are incorrect and need fixing? That's
hosts.c:int scsi_is_host_device(const struct device *dev)
scsi_scan.c:int scsi_is_target_device(const struct device *dev)
scsi_transport_fc.c:int scsi_is_fc_rport(const struct device *dev)
scsi_transport_fc.c:int scsi_is_fc_vport(const struct device *dev)
scsi_transport_iscsi.c:static int iscsi_is_session_dev(const struct
device *dev)
scsi_transport_iscsi.c:static int iscsi_is_conn_dev(const struct device
*dev)
scsi_transport_sas.c:int scsi_is_sas_phy(const struct device *dev)
scsi_transport_sas.c:int scsi_is_sas_port(const struct device *dev)
scsi_transport_sas.c:int scsi_is_sas_rphy(const struct device *dev)
Checking the release function is the way each of these passes the test.
James
next prev parent reply other threads:[~2007-09-26 20:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 17:54 [PATCH] fix leftover from default sdev attribute switch Kay Sievers
2007-09-26 18:23 ` James Bottomley
2007-09-26 18:32 ` Kay Sievers
2007-09-26 20:08 ` James Bottomley [this message]
2007-09-26 20:19 ` Kay Sievers
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=1190837311.3359.74.camel@localhost.localdomain \
--to=james.bottomley@steeleye.com \
--cc=kay.sievers@vrfy.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