diff options
author | 2024-08-30 15:37:19 -0700 | |
---|---|---|
committer | 2024-09-01 08:58:20 -0700 | |
commit | c460f0f1a2bc219495e19e43daac6f8c902d81d8 (patch) | |
tree | abb94625d4407ac0082a0aa50f3348bdf4e8a6f5 /fs/xfs | |
parent | xfs: fix C++ compilation errors in xfs_fs.h (diff) | |
download | wireguard-linux-c460f0f1a2bc219495e19e43daac6f8c902d81d8.tar.xz wireguard-linux-c460f0f1a2bc219495e19e43daac6f8c902d81d8.zip |
xfs: fix FITRIM reporting again
Don't report FITRIMming more bytes than possibly exist in the
filesystem.
Fixes: 410e8a18f8e93 ("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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_discard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index bf1e3f330018..d8c4a5dcca7a 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -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; |