This is my block ioctl series split up into managable chunks. I'm not
really sure about the last two of these, I'd prefer to get a second
opinion on those.Please apply once your tests have gone though.
Arnd <><
-
Goodness, thanks a lot Arnd! Applied 1-7 (with v2 of patch #1).
--
Jens Axboe-
BTW, one note: 0x1260 thing (
/* The mkswap binary hard codes it to Intel value :-((( */
case 0x1260:
case BLKGETSIZE:
) is an ancient piece of BS. It had appeared in 2.1.115-pre3 and AFAICS
it's a misunderstanding.What happens here:
* mkswap(8) used to hardcode BLKGETSIZE as 0x1260 (instead of
_IO(0x12,0x60)). If _IO is undefined, it still does. Several old
architectures (including i386) have the right value still equal to 0x1260
due to the way their _IO() is defined.
* 0x1260 does *NOT* work on sparc32, exactly because its _IO()
is different. _IO(0x12,0x60) works.
* sparc64 for some insane reason (I suspect misreading the mkswap
source) tries to support 0x1260 for 32bit tasks. Note that binary that
tries to pull that off will _not_ work on native sparc32.As the matter of fact, all biarch targets old enough to have 32bit counterpart
present prior to 1.3.45 (when BLKGETSIZE went _IO(0x12,60)) either have
it still equal to 0x1260 on both 32bit and 64bit (i386/amd64) or have it
_not_ equal to 0x1260 on either (ppc/ppc64 and sparc/sparc64). In the latter
case 0x1260 doesn't work on 32bit, so having it accepted from 32bit tasks
on 64bit is insane.IOW, that stuff is useless and always had been. In the current form it's
simply invalid C on e.g. amd64 - you get duplicate case there, which breaks
the build.I'd simply kill that.
-
From: Al Viro <viro@ftp.linux.org.uk>
Agreed.
-
Make compat_blkdev_ioctl and blkdev_ioctl reflect the respective
native versions. This is somewhat more efficient and makes it easier
to keep the two in sync.Also get rid of the bogus handling for broken_blkgetsize and the
duplicate entry for BLKRASET.Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
ok.
Index: linux-2.6/block/Makefile
===================================================================
--- linux-2.6.orig/block/Makefile
+++ linux-2.6/block/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_IOSCHED_DEADLINE) += deadli
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.oobj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
+obj-$(CONFIG_COMPAT) += compat_ioctl.o
Index: linux-2.6/block/compat_ioctl.c
===================================================================
--- /dev/null
+++ linux-2.6/block/compat_ioctl.c
@@ -0,0 +1,121 @@
+#include <linux/blkdev.h>
+#include <linux/blkpg.h>
+#include <linux/blktrace_api.h>
+#include <linux/cdrom.h>
+#include <linux/compat.h>
+#include <linux/elevator.h>
+#include <linux/fd.h>
+#include <linux/hdreg.h>
+#include <linux/syscalls.h>
+#include <linux/smp_lock.h>
+#include <linux/types.h>
+#include <linux/uaccess.h>
+
+static int compat_put_ushort(unsigned long arg, unsigned short val)
+{
+ return put_user(val, (unsigned short __user *)compat_ptr(arg));
+}
+
+static int compat_put_int(unsigned long arg, int val)
+{
+ return put_user(val, (compat_int_t __user *)compat_ptr(arg));
+}
+
+static int compat_put_long(unsigned long arg, long val)
+{
+ return put_user(val, (compat_long_t __user *)compat_ptr(arg));
+}
+
+static int compat_put_ulong(unsigned long arg, compat_ulong_t val)
+{
+ return put_user(val, (compat_ulong_t __user *)compat_ptr(arg));
+}
+
+static int compat_put_u64(unsigned long arg, u64 val)
+{
+ return put_user(val, (compat_u64 __user *)compat_ptr(arg));
+}
+
+#define BLKBSZGET_32 _IOR(0x12, 112, int)
+#define BLKBSZSET_3...
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Paul Jackson | Re: cpuset-remove-sched-domain-hooks-from-cpusets |
| Rafael J. Wysocki | [Bug #11210] libata badness |
| David Miller | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
git: | |
