Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bc58f9bb6be02a80b5f1f757b656c9affc07154f
Commit:     bc58f9bb6be02a80b5f1f757b656c9affc07154f
Parent:     d4f3cc016fd6b392d483adc586b6dfaabad081af
Author:     Eric Sandeen <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 12 11:13:22 2007 +1000
Committer:  Lachlan McIlroy <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 18:13:17 2008 +1100

    [XFS] fix 32-bit compat ioctls for GETXFLAGS, SETXFLAGS, GETVERSION
    
    XFS_IOC_GETVERSION, XFS_IOC_GETXFLAGS and XFS_IOC_SETXFLAGS all take a
    "long" which changes size between 32 and 64 bit platforms.
    
    So, the ioctl cmds that come in from a 32-bit app aren't as expected, for
    example on GETXFLAGS,
    
    unknown cmd fd(3) cmd(80046601){t:'f';sz:4}
    
    due to the size mismatch.
    
    So, use instead the 32-bit version of the commands for compat ioctls, and
    other than that it doesn't take any more manipulation.
    
    Also, for both native and compat versions, just define them to the values
    as defined in fs.h
    
    SGI-PV: 971186
    SGI-Modid: xfs-linux-melb:xfs-kern:29849a
    
    Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
    Signed-off-by: Lachlan McIlroy <[EMAIL PROTECTED]>
    Signed-off-by: Tim Shimmin <[EMAIL PROTECTED]>
---
 fs/xfs/linux-2.6/xfs_ioctl32.c |    8 +++++---
 fs/xfs/xfs_fs.h                |   10 +++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index bf2a956..83463c2 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -379,9 +379,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:
@@ -407,6 +404,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:
diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
index aab9662..3bed643 100644
--- a/fs/xfs/xfs_fs.h
+++ b/fs/xfs/xfs_fs.h
@@ -419,9 +419,13 @@ typedef struct xfs_handle {
 /*
  * ioctl commands that are used by Linux filesystems
  */
-#define XFS_IOC_GETXFLAGS      _IOR('f', 1, long)
-#define XFS_IOC_SETXFLAGS      _IOW('f', 2, long)
-#define XFS_IOC_GETVERSION     _IOR('v', 1, long)
+#define XFS_IOC_GETXFLAGS      FS_IOC_GETFLAGS
+#define XFS_IOC_SETXFLAGS      FS_IOC_SETFLAGS
+#define XFS_IOC_GETVERSION     FS_IOC_GETVERSION
+/* 32-bit compat counterparts */
+#define XFS_IOC32_GETXFLAGS    FS_IOC32_GETFLAGS
+#define XFS_IOC32_SETXFLAGS    FS_IOC32_SETFLAGS
+#define XFS_IOC32_GETVERSION   FS_IOC32_GETVERSION
 
 /*
  * ioctl commands that replace IRIX fcntl()'s
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to