diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2008-07-11 14:37:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-11 14:45:48 -0400 |
commit | 0ce3a7e5bd305e96c924fab1e3126480c665f017 (patch) | |
tree | b2bbd89c0e18f3a67a361bee738eef65562b212e | |
parent | 081a5bcb39b455405d58f79bb3c9398a9d4477ed (diff) |
[SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices
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>
-rw-r--r-- | drivers/scsi/ipr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 999e91ea7451..e7a3a6554425 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include <linux/module.h> | 71 | #include <linux/module.h> |
72 | #include <linux/moduleparam.h> | 72 | #include <linux/moduleparam.h> |
73 | #include <linux/libata.h> | 73 | #include <linux/libata.h> |
74 | #include <linux/hdreg.h> | ||
74 | #include <asm/io.h> | 75 | #include <asm/io.h> |
75 | #include <asm/irq.h> | 76 | #include <asm/irq.h> |
76 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
@@ -4913,8 +4914,11 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
4913 | struct ipr_resource_entry *res; | 4914 | struct ipr_resource_entry *res; |
4914 | 4915 | ||
4915 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4916 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4916 | if (res && ipr_is_gata(res)) | 4917 | if (res && ipr_is_gata(res)) { |
4918 | if (cmd == HDIO_GET_IDENTITY) | ||
4919 | return -ENOTTY; | ||
4917 | return ata_scsi_ioctl(sdev, cmd, arg); | 4920 | return ata_scsi_ioctl(sdev, cmd, arg); |
4921 | } | ||
4918 | 4922 | ||
4919 | return -EINVAL; | 4923 | return -EINVAL; |
4920 | } | 4924 | } |