Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Browse files Browse the repository at this point in the history
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: check if device support discard in xfs_ioc_trim()
  xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1
  • Loading branch information
Linus Torvalds committed Feb 23, 2011
2 parents f19e0ee + be71514 commit 13d1ea9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/xfs/linux-2.6/xfs_discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ xfs_ioc_trim(

if (!capable(CAP_SYS_ADMIN))
return -XFS_ERROR(EPERM);
if (!blk_queue_discard(q))
return -XFS_ERROR(EOPNOTSUPP);
if (copy_from_user(&range, urange, sizeof(range)))
return -XFS_ERROR(EFAULT);

Expand Down
3 changes: 3 additions & 0 deletions fs/xfs/xfs_fsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ xfs_fs_geometry(
xfs_fsop_geom_t *geo,
int new_version)
{

memset(geo, 0, sizeof(*geo));

geo->blocksize = mp->m_sb.sb_blocksize;
geo->rtextsize = mp->m_sb.sb_rextsize;
geo->agblocks = mp->m_sb.sb_agblocks;
Expand Down

0 comments on commit 13d1ea9

Please sign in to comment.