diff options
author | sandeen@sandeen.net <sandeen@sandeen.net> | 2008-11-25 22:20:12 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-02 01:16:03 -0500 |
commit | 65fbaf2489c667bf79ae1f20403f30c66568d445 (patch) | |
tree | 9694dd8017f997730755dec5e58a2324361cf577 /fs/xfs/xfs_itable.h | |
parent | 2ee4fa5cb716eba104a4ef8efe159e1007a2aef6 (diff) |
[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>
Diffstat (limited to 'fs/xfs/xfs_itable.h')
-rw-r--r-- | fs/xfs/xfs_itable.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h index e210a4c06569..1fb04e7deb61 100644 --- a/fs/xfs/xfs_itable.h +++ b/fs/xfs/xfs_itable.h | |||
@@ -71,6 +71,8 @@ xfs_bulkstat_single( | |||
71 | 71 | ||
72 | typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */ | 72 | typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */ |
73 | void __user *ubuffer, /* buffer to write to */ | 73 | void __user *ubuffer, /* buffer to write to */ |
74 | int ubsize, /* remaining user buffer sz */ | ||
75 | int *ubused, /* bytes used by formatter */ | ||
74 | const xfs_bstat_t *buffer); /* buffer to read from */ | 76 | const xfs_bstat_t *buffer); /* buffer to read from */ |
75 | 77 | ||
76 | int | 78 | int |