Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329032
b: refs/heads/master
c: 643bfc0
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Racek authored and Ben Myers committed Aug 16, 2012
1 parent d35cc87 commit d3730db
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: c4982110ae93d7575503feb81d15e93c0c5f393c
refs/heads/master: 643bfc061c47e9c7661324a09fb0a0bc6601e5d6
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 d3730db

Please sign in to comment.