[SCSI] mpt2sas : running out of message frames
[safe/jmp/linux-2.6] / drivers / scsi / scsi_ioctl.c
index 2ee49f8..b98f763 100644 (file)
@@ -94,7 +94,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
        SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", *cmd));
 
        result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0,
-                                 &sshdr, timeout, retries);
+                                 &sshdr, timeout, retries, NULL);
 
        SCSI_LOG_IOCTL(2, printk("Ioctl returned  0x%x\n", result));
 
@@ -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;
 }