public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xfs: remove a stale comment in xfs_ioc_trim
@ 2024-08-14  4:23 Christoph Hellwig
  2024-08-14  4:23 ` [PATCH 2/2] xfs: don't extend the FITRIM range if the rt device does not support discard Christoph Hellwig
  2024-08-14  5:12 ` [PATCH 1/2] xfs: remove a stale comment in xfs_ioc_trim Darrick J. Wong
  0 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2024-08-14  4:23 UTC (permalink / raw)
  To: chandan.babu; +Cc: djwong, linux-xfs

There is no truncating down going on here, the code has changed multiple
times since the comment was added with the initial FITRIM implementation
and it doesn't make sense in the current context.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_discard.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 6f0fc7fe1f2ba9..6516afecce0979 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -689,13 +689,6 @@ xfs_ioc_trim(
 	range.minlen = max_t(u64, granularity, range.minlen);
 	minlen = XFS_B_TO_FSB(mp, range.minlen);
 
-	/*
-	 * Truncating down the len isn't actually quite correct, but using
-	 * BBTOB would mean we trivially get overflows for values
-	 * of ULLONG_MAX or slightly lower.  And ULLONG_MAX is the default
-	 * used by the fstrim application.  In the end it really doesn't
-	 * matter as trimming blocks is an advisory interface.
-	 */
 	max_blocks = mp->m_sb.sb_dblocks + mp->m_sb.sb_rblocks;
 	if (range.start >= XFS_FSB_TO_B(mp, max_blocks) ||
 	    range.minlen > XFS_FSB_TO_B(mp, mp->m_ag_max_usable) ||
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* fix FITRIM with non-discard capable RT device v2
@ 2024-08-16  8:18 Christoph Hellwig
  2024-08-16  8:18 ` [PATCH 2/2] xfs: don't extend the FITRIM range if the rt device does not support discard Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2024-08-16  8:18 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: Darrick J. Wong, linux-xfs

Hi all,

this series fixes FITRIM when an RT device that does not support
discards is present.

Changes since v1:
 - explicitly reject the discard capable RT device and non-discard capable
   main device case because it is too much of a mess to handle and not
   practically useful

Diffstat:
 xfs_discard.c |   57 +++++++++++++++++++++++++++++++--------------------------
 1 file changed, 31 insertions(+), 26 deletions(-)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-08-20 16:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14  4:23 [PATCH 1/2] xfs: remove a stale comment in xfs_ioc_trim Christoph Hellwig
2024-08-14  4:23 ` [PATCH 2/2] xfs: don't extend the FITRIM range if the rt device does not support discard Christoph Hellwig
2024-08-14  5:41   ` Darrick J. Wong
2024-08-14  5:48     ` Christoph Hellwig
2024-08-14  6:16       ` Darrick J. Wong
2024-08-14  5:12 ` [PATCH 1/2] xfs: remove a stale comment in xfs_ioc_trim Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2024-08-16  8:18 fix FITRIM with non-discard capable RT device v2 Christoph Hellwig
2024-08-16  8:18 ` [PATCH 2/2] xfs: don't extend the FITRIM range if the rt device does not support discard Christoph Hellwig
2024-08-16 21:50   ` Darrick J. Wong
2024-08-19 12:44     ` Christoph Hellwig
2024-08-19 15:00       ` Darrick J. Wong
2024-08-19 15:08         ` Christoph Hellwig
2024-08-20 16:19           ` Darrick J. Wong
2024-08-20 16:35             ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox