From: Ben Collins <bcollins@debian.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Torrey Hoffman <thoffman@arnor.net>,
linux-scsi@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Re: scsi_add_device() broken? (was Re: SBP2 hotplug doesn't update /proc/partitions)
Date: Fri, 13 Jun 2003 12:08:12 -0400 [thread overview]
Message-ID: <20030613160812.GA520@hopper.phunnypharm.org> (raw)
In-Reply-To: <20030613024044.GA499@hopper.phunnypharm.org>
> scsi0 : SCSI emulation for IEEE-1394 SBP-2 Devices
> ieee1394: sbp2: Query logins to SBP-2 device successful
> ieee1394: sbp2: Maximum concurrent logins supported: 1
> ieee1394: sbp2: Number of active logins: 0
> ieee1394: sbp2: Logged into SBP-2 device
> ieee1394: sbp2: Node[02:1023]: Max speed [S400] - Max payload [2048]
> Vendor: FireWire Model: 1394 Disk Drive Rev: G603
> Type: Direct-Access ANSI SCSI revision: 02
> SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
> sda: cache data unavailable
> sda: assuming drive cache: write through
> sda: unknown partition table
> devfs_mk_dir: invalid argument.<5>Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Here's the scenario. scsi_add_lun doesn't set sdp->devfs_name before
calling scsi_register_device(). Since scsi_register_device calls down to
things like sd_probe, which do try to use sdp->devfs_name, things fail.
Just an easy change, moving the sdp->devfs_name creation before calling
scsi_register_device(). Patch fixes this.
Index: linux-2.5/drivers/scsi/scsi_scan.c
===================================================================
--- linux-2.5/drivers/scsi/scsi_scan.c (revision 10937)
+++ linux-2.5/drivers/scsi/scsi_scan.c (working copy)
@@ -619,12 +619,12 @@
if (inq_result[7] & 0x10)
sdev->sdtr = 1;
- scsi_device_register(sdev);
-
sprintf(sdev->devfs_name, "scsi/host%d/bus%d/target%d/lun%d",
sdev->host->host_no, sdev->channel,
sdev->id, sdev->lun);
+ scsi_device_register(sdev);
+
/*
* End driverfs/devfs code.
*/
--
Debian - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo - http://www.deqo.com/
next prev parent reply other threads:[~2003-06-13 16:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-04 23:48 Another must-fix: sbp2 and firewire hard disk crashes hard Torrey Hoffman
2003-06-04 23:55 ` Andrew Morton
[not found] ` <1054838369.1737.11.camel@torrey.et.myrio.com>
[not found] ` <20030605175412.GF625@phunnypharm.org>
[not found] ` <1054858724.3519.19.camel@torrey.et.myrio.com>
[not found] ` <20030606025721.GJ625@phunnypharm.org>
2003-06-12 19:28 ` SBP2 hotplug doesn't update /proc/partitions Torrey Hoffman
2003-06-12 19:52 ` Erik Andersen
2003-06-12 20:07 ` Torrey Hoffman
2003-06-12 19:52 ` Ben Collins
2003-06-13 2:40 ` scsi_add_device() broken? (was Re: SBP2 hotplug doesn't update /proc/partitions) Ben Collins
2003-06-13 16:08 ` Ben Collins [this message]
2003-06-13 17:19 ` [PATCH] " Patrick Mansfield
2003-06-12 20:21 ` SBP2 hotplug doesn't update /proc/partitions Torrey Hoffman
2003-06-05 8:03 ` Another must-fix: sbp2 and firewire hard disk crashes hard Benjamin Herrenschmidt
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=20030613160812.GA520@hopper.phunnypharm.org \
--to=bcollins@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=thoffman@arnor.net \
--cc=torvalds@transmeta.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