xfs: Fix error return for fallocate() on XFS
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 11 Mar 2010 22:42:03 +0000 (09:42 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:14 +0000 (07:41 -0700)
commitb3e6e64f48177a32c07364e4c699ae4db0ff7807
treec8bceee89cb99c0f197a99132cb83687b3e2c4f3
parentce49b28e33e5d526e77fca788658f1d97c29a528
xfs: Fix error return for fallocate() on XFS

commit 44a743f68705c681439f264deb05f8f38e9048d3 upstream

Noticed that through glibc fallocate would return 28 rather than -1
and errno = 28 for ENOSPC. The xfs routines uses XFS_ERROR format
positive return error codes while the syscalls use negative return
codes.  Fixup the two cases in xfs_vn_fallocate syscall to convert to
negative.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/linux-2.6/xfs_iops.c