diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2007-10-11 21:13:22 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 02:13:17 -0500 |
commit | bc58f9bb6be02a80b5f1f757b656c9affc07154f (patch) | |
tree | 1e9f4f89f1dd9cb64080e36eaec85337f2d0a0c3 /fs/xfs/linux-2.6 | |
parent | d4f3cc016fd6b392d483adc586b6dfaabad081af (diff) |
[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 <sandeen@sandeen.net>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index bf2a956b63c2..83463c27545c 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( | |||
379 | switch (cmd) { | 379 | switch (cmd) { |
380 | case XFS_IOC_DIOINFO: | 380 | case XFS_IOC_DIOINFO: |
381 | case XFS_IOC_FSGEOMETRY: | 381 | case XFS_IOC_FSGEOMETRY: |
382 | case XFS_IOC_GETVERSION: | ||
383 | case XFS_IOC_GETXFLAGS: | ||
384 | case XFS_IOC_SETXFLAGS: | ||
385 | case XFS_IOC_FSGETXATTR: | 382 | case XFS_IOC_FSGETXATTR: |
386 | case XFS_IOC_FSSETXATTR: | 383 | case XFS_IOC_FSSETXATTR: |
387 | case XFS_IOC_FSGETXATTRA: | 384 | case XFS_IOC_FSGETXATTRA: |
@@ -407,6 +404,11 @@ xfs_compat_ioctl( | |||
407 | case XFS_IOC_ERROR_CLEARALL: | 404 | case XFS_IOC_ERROR_CLEARALL: |
408 | break; | 405 | break; |
409 | 406 | ||
407 | case XFS_IOC32_GETXFLAGS: | ||
408 | case XFS_IOC32_SETXFLAGS: | ||
409 | case XFS_IOC32_GETVERSION: | ||
410 | cmd = _NATIVE_IOC(cmd, long); | ||
411 | break; | ||
410 | #ifdef BROKEN_X86_ALIGNMENT | 412 | #ifdef BROKEN_X86_ALIGNMENT |
411 | /* xfs_flock_t has wrong u32 vs u64 alignment */ | 413 | /* xfs_flock_t has wrong u32 vs u64 alignment */ |
412 | case XFS_IOC_ALLOCSP_32: | 414 | case XFS_IOC_ALLOCSP_32: |