aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsandeen@sandeen.net <sandeen@sandeen.net>2008-11-25 22:20:13 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-12-02 01:16:24 -0500
commitaf819d27637119105213433881f158931e29620b (patch)
tree306b641d6be0ebd7d88ee6df7d1a53d56dc830f4
parent65fbaf2489c667bf79ae1f20403f30c66568d445 (diff)
[XFS] Fix compat XFS_IOC_FSBULKSTAT_SINGLE ioctl
The XFS_IOC_FSBULKSTAT_SINGLE ioctl passes in the desired inode number, while XFS_IOC_FSBULKSTAT passes in the previous/last-stat'd inode number. The compat handler wasn't differentiating these, so when a XFS_IOC_FSBULKSTAT_SINGLE request for inode 128 was sent in, stat information for 131 was sent out. Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index 2d336062831d..cc1fe96efab5 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -291,15 +291,22 @@ xfs_compat_ioc_bulkstat(
291 if (bulkreq.ubuffer == NULL) 291 if (bulkreq.ubuffer == NULL)
292 return -XFS_ERROR(EINVAL); 292 return -XFS_ERROR(EINVAL);
293 293
294 if (cmd == XFS_IOC_FSINUMBERS_32) 294 if (cmd == XFS_IOC_FSINUMBERS_32) {
295 error = xfs_inumbers(mp, &inlast, &count, 295 error = xfs_inumbers(mp, &inlast, &count,
296 bulkreq.ubuffer, xfs_inumbers_fmt_compat); 296 bulkreq.ubuffer, xfs_inumbers_fmt_compat);
297 else { 297 } else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE_32) {
298 int res;
299
300 error = xfs_bulkstat_one_compat(mp, inlast, bulkreq.ubuffer,
301 sizeof(compat_xfs_bstat_t),
302 NULL, 0, NULL, NULL, &res);
303 } else if (cmd == XFS_IOC_FSBULKSTAT_32) {
298 error = xfs_bulkstat(mp, &inlast, &count, 304 error = xfs_bulkstat(mp, &inlast, &count,
299 xfs_bulkstat_one_compat, NULL, 305 xfs_bulkstat_one_compat, NULL,
300 sizeof(compat_xfs_bstat_t), bulkreq.ubuffer, 306 sizeof(compat_xfs_bstat_t), bulkreq.ubuffer,
301 BULKSTAT_FG_QUICK, &done); 307 BULKSTAT_FG_QUICK, &done);
302 } 308 } else
309 error = XFS_ERROR(EINVAL);
303 if (error) 310 if (error)
304 return -error; 311 return -error;
305 312