]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_ioctl32.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_ioctl32.c
index 0046bdd5b7f11df4bf077e5144e306f01608e6ee..a4b254eb43b2ec74151ada8ffb1e9fc2dd41cfab 100644 (file)
@@ -44,6 +44,7 @@
 #include "xfs_error.h"
 #include "xfs_dfrag.h"
 #include "xfs_vnodeops.h"
+#include "xfs_ioctl32.h"
 
 #define  _NATIVE_IOC(cmd, type) \
          _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
@@ -291,6 +292,9 @@ xfs_ioc_bulkstat_compat(
        if ((count = bulkreq.icount) <= 0)
                return -XFS_ERROR(EINVAL);
 
+       if (bulkreq.ubuffer == NULL)
+               return -XFS_ERROR(EINVAL);
+
        if (cmd == XFS_IOC_FSINUMBERS)
                error = xfs_inumbers(mp, &inlast, &count,
                                bulkreq.ubuffer, xfs_inumbers_fmt_compat);
@@ -376,9 +380,6 @@ xfs_compat_ioctl(
        switch (cmd) {
        case XFS_IOC_DIOINFO:
        case XFS_IOC_FSGEOMETRY:
-       case XFS_IOC_GETVERSION:
-       case XFS_IOC_GETXFLAGS:
-       case XFS_IOC_SETXFLAGS:
        case XFS_IOC_FSGETXATTR:
        case XFS_IOC_FSSETXATTR:
        case XFS_IOC_FSGETXATTRA:
@@ -404,6 +405,11 @@ xfs_compat_ioctl(
        case XFS_IOC_ERROR_CLEARALL:
                break;
 
+       case XFS_IOC32_GETXFLAGS:
+       case XFS_IOC32_SETXFLAGS:
+       case XFS_IOC32_GETVERSION:
+               cmd = _NATIVE_IOC(cmd, long);
+               break;
 #ifdef BROKEN_X86_ALIGNMENT
        /* xfs_flock_t has wrong u32 vs u64 alignment */
        case XFS_IOC_ALLOCSP_32: