summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-03 12:44:22 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-03 12:44:22 -0800
commit4c7fd114c65830cb052b6f3d0ab5b11626e64d5d (patch)
treebc6e04138c59caa5661f8ae5f9b833125ae4f26c /fs
parentc640e13f8efeb38daa4c0b0891a46d32b01e51ac (diff)
parentaf24ee9ea8d532e16883251a6684dfa1be8eec29 (diff)
downloadop-kernel-dev-4c7fd114c65830cb052b6f3d0ab5b11626e64d5d.zip
op-kernel-dev-4c7fd114c65830cb052b6f3d0ab5b11626e64d5d.tar.gz
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: zero proper structure size for geometry calls
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index f5e2a19..0ca0e3c 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -695,14 +695,19 @@ xfs_ioc_fsgeometry_v1(
xfs_mount_t *mp,
void __user *arg)
{
- xfs_fsop_geom_v1_t fsgeo;
+ xfs_fsop_geom_t fsgeo;
int error;
- error = xfs_fs_geometry(mp, (xfs_fsop_geom_t *)&fsgeo, 3);
+ error = xfs_fs_geometry(mp, &fsgeo, 3);
if (error)
return -error;
- if (copy_to_user(arg, &fsgeo, sizeof(fsgeo)))
+ /*
+ * Caller should have passed an argument of type
+ * xfs_fsop_geom_v1_t. This is a proper subset of the
+ * xfs_fsop_geom_t that xfs_fs_geometry() fills in.
+ */
+ if (copy_to_user(arg, &fsgeo, sizeof(xfs_fsop_geom_v1_t)))
return -XFS_ERROR(EFAULT);
return 0;
}
OpenPOWER on IntegriCloud