diff options
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_discard.c | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_fsops.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_discard.c b/fs/xfs/linux-2.6/xfs_discard.c index 05201ae719e5..d61611c88012 100644 --- a/fs/xfs/linux-2.6/xfs_discard.c +++ b/fs/xfs/linux-2.6/xfs_discard.c | |||
| @@ -152,6 +152,8 @@ xfs_ioc_trim( | |||
| 152 | 152 | ||
| 153 | if (!capable(CAP_SYS_ADMIN)) | 153 | if (!capable(CAP_SYS_ADMIN)) |
| 154 | return -XFS_ERROR(EPERM); | 154 | return -XFS_ERROR(EPERM); |
| 155 | if (!blk_queue_discard(q)) | ||
| 156 | return -XFS_ERROR(EOPNOTSUPP); | ||
| 155 | if (copy_from_user(&range, urange, sizeof(range))) | 157 | if (copy_from_user(&range, urange, sizeof(range))) |
| 156 | return -XFS_ERROR(EFAULT); | 158 | return -XFS_ERROR(EFAULT); |
| 157 | 159 | ||
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index cec89dd5d7d2..85668efb3e3e 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
| @@ -53,6 +53,9 @@ xfs_fs_geometry( | |||
| 53 | xfs_fsop_geom_t *geo, | 53 | xfs_fsop_geom_t *geo, |
| 54 | int new_version) | 54 | int new_version) |
| 55 | { | 55 | { |
| 56 | |||
| 57 | memset(geo, 0, sizeof(*geo)); | ||
| 58 | |||
| 56 | geo->blocksize = mp->m_sb.sb_blocksize; | 59 | geo->blocksize = mp->m_sb.sb_blocksize; |
| 57 | geo->rtextsize = mp->m_sb.sb_rextsize; | 60 | geo->rtextsize = mp->m_sb.sb_rextsize; |
| 58 | geo->agblocks = mp->m_sb.sb_agblocks; | 61 | geo->agblocks = mp->m_sb.sb_agblocks; |
