]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices
authorBrian King <brking@linux.vnet.ibm.com>
Fri, 11 Jul 2008 18:37:50 +0000 (13:37 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 11 Jul 2008 18:45:48 +0000 (13:45 -0500)
Currently, ipr does not support HDIO_GET_IDENTITY to SATA devices.
An oops occurs if userspace attempts to send the command. Since hald
issues the command, ensure we fail the ioctl in ipr. This is a
temporary solution to the oops. Once the ipr libata EH conversion
is upstream, ipr will fully support HDIO_GET_IDENTITY.

Tested-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/ipr.c

index 999e91ea745139bba95caf0b9bd5224254ff9190..e7a3a655442562186328d81df9d81be9f744f5f6 100644 (file)
@@ -71,6 +71,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/libata.h>
+#include <linux/hdreg.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/processor.h>
@@ -4913,8 +4914,11 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
        struct ipr_resource_entry *res;
 
        res = (struct ipr_resource_entry *)sdev->hostdata;
-       if (res && ipr_is_gata(res))
+       if (res && ipr_is_gata(res)) {
+               if (cmd == HDIO_GET_IDENTITY)
+                       return -ENOTTY;
                return ata_scsi_ioctl(sdev, cmd, arg);
+       }
 
        return -EINVAL;
 }