mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
xfs: fix FITRIM reporting again
Don't report FITRIMming more bytes than possibly exist in the
filesystem.
Fixes: 410e8a18f8
("xfs: don't bother reporting blocks trimmed via FITRIM")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
64dfa18d6e
commit
c460f0f1a2
@ -707,7 +707,7 @@ xfs_ioc_trim(
|
||||
return last_error;
|
||||
|
||||
range.len = min_t(unsigned long long, range.len,
|
||||
XFS_FSB_TO_B(mp, max_blocks));
|
||||
XFS_FSB_TO_B(mp, max_blocks) - range.start);
|
||||
if (copy_to_user(urange, &range, sizeof(range)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user