lkml.org 
[lkml]   [2003]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Re: scsi_add_device() broken? (was Re: SBP2 hotplug doesn't update /proc/partitions)
> 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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.052 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site