Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c7fd114 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents c640e13f af24ee9e
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -695,14 +695,19 @@ xfs_ioc_fsgeometry_v1(
	xfs_mount_t		*mp,
	xfs_mount_t		*mp,
	void			__user *arg)
	void			__user *arg)
{
{
	xfs_fsop_geom_v1_t	fsgeo;
	xfs_fsop_geom_t         fsgeo;
	int			error;
	int			error;


	error = xfs_fs_geometry(mp, (xfs_fsop_geom_t *)&fsgeo, 3);
	error = xfs_fs_geometry(mp, &fsgeo, 3);
	if (error)
	if (error)
		return -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 -XFS_ERROR(EFAULT);
	return 0;
	return 0;
}
}