diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 06:29:08 +0100 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-14 06:29:08 +0100 |
commit | c088f4e9da74b901f7ed1749ad697d77622ed0f9 (patch) | |
tree | 84cddf20369f82f10c1c3712e6cce20dd1b9d863 /drivers/scsi/scsi_ioctl.c | |
parent | Merge branch 'for-linus' of git+ssh://git.melbourne.sgi.com/git/xfs (diff) | |
parent | Merge branch 'x86-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
download | linux-c088f4e9da74b901f7ed1749ad697d77622ed0f9.tar.xz linux-c088f4e9da74b901f7ed1749ad697d77622ed0f9.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 2ae4f8fc5831..b98f763931c5 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -167,10 +167,17 @@ EXPORT_SYMBOL(scsi_set_medium_removal); static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) { struct device *dev = scsi_get_device(sdev->host); + const char *name; if (!dev) return -ENXIO; - return copy_to_user(arg, dev->bus_id, sizeof(dev->bus_id))? -EFAULT: 0; + + name = dev_name(dev); + + /* compatibility with old ioctl which only returned + * 20 characters */ + return copy_to_user(arg, name, min(strlen(name), (size_t)20)) + ? -EFAULT: 0; } |