[XFS] Fix xfs_bulkstat_one size checks & error handling
authorsandeen@sandeen.net <sandeen@sandeen.net>
Wed, 26 Nov 2008 03:20:12 +0000 (21:20 -0600)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Tue, 2 Dec 2008 06:16:03 +0000 (17:16 +1100)
commit65fbaf2489c667bf79ae1f20403f30c66568d445
tree9694dd8017f997730755dec5e58a2324361cf577
parent2ee4fa5cb716eba104a4ef8efe159e1007a2aef6
[XFS] Fix xfs_bulkstat_one size checks & error handling

The 32-bit xfs_blkstat_one handler was failing because
a size check checked whether the remaining (32-bit)
user buffer was less than the (64-bit) bulkstat buffer,
and failed with ENOMEM if so.  Move this check
into the respective handlers so that they check the
correct sizes.

Also, the formatters were returning negative errors
or positive bytes copied; this was odd in the positive
error value world of xfs, and handled wrong by at least
some of the callers, which treated the bytes returned
as an error value.  Move the bytes-used assignment
into the formatters.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_ioctl32.c
fs/xfs/xfs_itable.c
fs/xfs/xfs_itable.h