diff options
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 999c1efd6af5..20b4c7af2928 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -1720,23 +1720,17 @@ xfs_file_ioctl( | |||
1720 | return -error; | 1720 | return -error; |
1721 | 1721 | ||
1722 | case XFS_IOC_FREE_EOFBLOCKS: { | 1722 | case XFS_IOC_FREE_EOFBLOCKS: { |
1723 | struct xfs_eofblocks eofb; | 1723 | struct xfs_fs_eofblocks eofb; |
1724 | struct xfs_eofblocks keofb; | ||
1724 | 1725 | ||
1725 | if (copy_from_user(&eofb, arg, sizeof(eofb))) | 1726 | if (copy_from_user(&eofb, arg, sizeof(eofb))) |
1726 | return -XFS_ERROR(EFAULT); | 1727 | return -XFS_ERROR(EFAULT); |
1727 | 1728 | ||
1728 | if (eofb.eof_version != XFS_EOFBLOCKS_VERSION) | 1729 | error = xfs_fs_eofblocks_from_user(&eofb, &keofb); |
1729 | return -XFS_ERROR(EINVAL); | 1730 | if (error) |
1730 | 1731 | return -error; | |
1731 | if (eofb.eof_flags & ~XFS_EOF_FLAGS_VALID) | ||
1732 | return -XFS_ERROR(EINVAL); | ||
1733 | |||
1734 | if (memchr_inv(&eofb.pad32, 0, sizeof(eofb.pad32)) || | ||
1735 | memchr_inv(eofb.pad64, 0, sizeof(eofb.pad64))) | ||
1736 | return -XFS_ERROR(EINVAL); | ||
1737 | 1732 | ||
1738 | error = xfs_icache_free_eofblocks(mp, &eofb); | 1733 | return -xfs_icache_free_eofblocks(mp, &keofb); |
1739 | return -error; | ||
1740 | } | 1734 | } |
1741 | 1735 | ||
1742 | default: | 1736 | default: |