Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322255
b: refs/heads/master
c: a672e1b
h: refs/heads/master
i:
  322253: 970436e
  322251: 32d43d6
  322247: 6f39879
  322239: e326cf2
v: v3
  • Loading branch information
Tomas Racek authored and Ben Myers committed Aug 23, 2012
1 parent 75291a0 commit 3fab41e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 761290309939743ddf97e2bd94c6da18c6436b79
refs/heads/master: a672e1be30d5bc848cd0067c55ed29b2015b7c17
6 changes: 4 additions & 2 deletions trunk/fs/xfs/xfs_discard.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ xfs_ioc_trim(
* used by the fstrim application. In the end it really doesn't
* matter as trimming blocks is an advisory interface.
*/
if (range.start >= XFS_FSB_TO_B(mp, mp->m_sb.sb_dblocks) ||
range.minlen > XFS_FSB_TO_B(mp, XFS_ALLOC_AG_MAX_USABLE(mp)))
return -XFS_ERROR(EINVAL);

start = BTOBB(range.start);
end = start + BTOBBT(range.len) - 1;
minlen = BTOBB(max_t(u64, granularity, range.minlen));

if (XFS_BB_TO_FSB(mp, start) >= mp->m_sb.sb_dblocks)
return -XFS_ERROR(EINVAL);
if (end > XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks) - 1)
end = XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)- 1;

Expand Down

0 comments on commit 3fab41e

Please sign in to comment.