* [PATCH] Add compat_ioctl to scsi host structure
@ 2005-01-18 11:03 Andi Kleen
2005-01-18 15:35 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-01-18 11:03 UTC (permalink / raw)
To: James.Bottomley, linux-scsi
Add a call vector for 32bit compat ioctls to the SCSI host
structure. This is needed for some followon patches.
Signed-off-by: Andi Kleen <ak@muc.de>
diff -u linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h-o linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h
--- linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h-o 2005-01-14 10:12:26.000000000 +0100
+++ linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h 2005-01-18 03:05:31.000000000 +0100
@@ -71,6 +71,16 @@
* Status: OPTIONAL
*/
int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
+
+
+ /*
+ * Compat handler. Handle 32bit ABI.
+ * When unknown ioctl is passed return -ENOIOCTLCMD.
+ * When called the BKL is not hold.
+ * Status: OPTIONAL
+ */
+ int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
+
/*
* The queuecommand function is used to queue up a scsi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Add compat_ioctl to scsi host structure
2005-01-18 11:03 [PATCH] Add compat_ioctl to scsi host structure Andi Kleen
@ 2005-01-18 15:35 ` James Bottomley
2005-01-18 23:27 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2005-01-18 15:35 UTC (permalink / raw)
To: Andi Kleen; +Cc: SCSI Mailing List
On Tue, 2005-01-18 at 12:03 +0100, Andi Kleen wrote:
> Add a call vector for 32bit compat ioctls to the SCSI host
> structure. This is needed for some followon patches.
>
> Signed-off-by: Andi Kleen <ak@muc.de>
Shouldn't this also be surrounded by #ifdef CONFIG_COMPAT (on the
grounds that you never fill it in unless CONFIG_COMPAT is defined)?
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Add compat_ioctl to scsi host structure
2005-01-18 15:35 ` James Bottomley
@ 2005-01-18 23:27 ` Andi Kleen
2005-01-19 15:55 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2005-01-18 23:27 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
On Tue, Jan 18, 2005 at 07:35:36AM -0800, James Bottomley wrote:
> On Tue, 2005-01-18 at 12:03 +0100, Andi Kleen wrote:
> > Add a call vector for 32bit compat ioctls to the SCSI host
> > structure. This is needed for some followon patches.
> >
> > Signed-off-by: Andi Kleen <ak@muc.de>
>
> Shouldn't this also be surrounded by #ifdef CONFIG_COMPAT (on the
> grounds that you never fill it in unless CONFIG_COMPAT is defined)?
At least the standard file_operations has it without ifdef.
I guess it doesn't hurt too much even on non compat systems.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Add compat_ioctl to scsi host structure
2005-01-18 23:27 ` Andi Kleen
@ 2005-01-19 15:55 ` James Bottomley
2005-01-19 16:03 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2005-01-19 15:55 UTC (permalink / raw)
To: Andi Kleen; +Cc: SCSI Mailing List
On Wed, 2005-01-19 at 00:27 +0100, Andi Kleen wrote:
> On Tue, Jan 18, 2005 at 07:35:36AM -0800, James Bottomley wrote:
> > Shouldn't this also be surrounded by #ifdef CONFIG_COMPAT (on the
> > grounds that you never fill it in unless CONFIG_COMPAT is defined)?
>
> At least the standard file_operations has it without ifdef.
> I guess it doesn't hurt too much even on non compat systems.
Well, I wasn't really thinking of saving the four or eight bytes for the
pointer: It looks, from all the other patches, that the policy is that
any compat ioctl code should be surrounded by #ifdef CONFIG_COMPAT.
Thus, an easy way to enforce this policy is to do the same to the
structure definition, so the compiler will error if the driver writer
doesn't do it and tries to compile on a non-CONFIG_COMPAT platform.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Add compat_ioctl to scsi host structure
2005-01-19 15:55 ` James Bottomley
@ 2005-01-19 16:03 ` Andi Kleen
0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2005-01-19 16:03 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List
On Wed, Jan 19, 2005 at 07:55:01AM -0800, James Bottomley wrote:
> On Wed, 2005-01-19 at 00:27 +0100, Andi Kleen wrote:
> > On Tue, Jan 18, 2005 at 07:35:36AM -0800, James Bottomley wrote:
> > > Shouldn't this also be surrounded by #ifdef CONFIG_COMPAT (on the
> > > grounds that you never fill it in unless CONFIG_COMPAT is defined)?
> >
> > At least the standard file_operations has it without ifdef.
> > I guess it doesn't hurt too much even on non compat systems.
>
> Well, I wasn't really thinking of saving the four or eight bytes for the
> pointer: It looks, from all the other patches, that the policy is that
> any compat ioctl code should be surrounded by #ifdef CONFIG_COMPAT.
> Thus, an easy way to enforce this policy is to do the same to the
> structure definition, so the compiler will error if the driver writer
> doesn't do it and tries to compile on a non-CONFIG_COMPAT platform.
Here's a new patch with the ifdef.
Add compat_ioctl vector to scsi_host.
Signed-off-by: Andi Kleen <ak@muc.de>
diff -u linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h-o linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h
--- linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h-o 2005-01-14 10:12:26.000000000 +0100
+++ linux-2.6.11-rc1-bk4/include/scsi/scsi_host.h 2005-01-19 17:01:21.000000000 +0100
@@ -71,7 +71,18 @@
* Status: OPTIONAL
*/
int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
-
+
+
+#ifdef CONFIG_COMPAT
+ /*
+ * Compat handler. Handle 32bit ABI.
+ * When unknown ioctl is passed return -ENOIOCTLCMD.
+ *
+ * Status: OPTIONAL
+ */
+ int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
+#endif
+
/*
* The queuecommand function is used to queue up a scsi
* command block to the LLDD. When the driver finished
diff -u linux-2.6.11-rc1-bk4/include/scsi/scsi_ioctl.h-o linux-2.6.11-rc1-bk4/include/scsi/scsi_ioctl.h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-01-19 16:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18 11:03 [PATCH] Add compat_ioctl to scsi host structure Andi Kleen
2005-01-18 15:35 ` James Bottomley
2005-01-18 23:27 ` Andi Kleen
2005-01-19 15:55 ` James Bottomley
2005-01-19 16:03 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox