summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pm8001
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-11-30 20:28:12 +0100
committerArnd Bergmann <arnd@arndb.de>2020-01-03 09:42:52 +0100
commit75c0b0e118b929cb8bad8ce1ab4c8be8a76c45e2 (patch)
tree9423d5bb2540f01059ad89881c72325bbc615b4c /drivers/scsi/pm8001
parent64cbfa96551a1511b9babef06afa06a1c6c4e8f5 (diff)
downloadlinux-75c0b0e118b929cb8bad8ce1ab4c8be8a76c45e2.tar.gz
linux-75c0b0e118b929cb8bad8ce1ab4c8be8a76c45e2.tar.bz2
linux-75c0b0e118b929cb8bad8ce1ab4c8be8a76c45e2.zip
compat_ioctl: scsi: handle HDIO commands from drivers
The ata_sas_scsi_ioctl() function implements a number of HDIO_* commands for SCSI devices, it is used by all libata drivers as well as a few drivers that support SAS attached SATA drives. The only command that is not safe for compat ioctls here is HDIO_GET_32BIT. Change the implementation to check for in_compat_syscall() in order to do both cases correctly, and change all callers to use it as both native and compat callback pointers, including the indirect callers through sas_ioctl and ata_scsi_ioctl. Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/scsi/pm8001')
-rw-r--r--drivers/scsi/pm8001/pm8001_init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index ff618ad80ebd..3c6076e4c6d2 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -101,6 +101,9 @@ static struct scsi_host_template pm8001_sht = {
.eh_target_reset_handler = sas_eh_target_reset_handler,
.target_destroy = sas_target_destroy,
.ioctl = sas_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = sas_ioctl,
+#endif
.shost_attrs = pm8001_host_attrs,
.track_queue_depth = 1,
};