From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: chandan.babu@oracle.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: remove a stale comment in xfs_ioc_trim
Date: Tue, 13 Aug 2024 22:12:47 -0700 [thread overview]
Message-ID: <20240814051247.GD865349@frogsfrogsfrogs> (raw)
In-Reply-To: <20240814042358.19297-1-hch@lst.de>
On Wed, Aug 14, 2024 at 06:23:57AM +0200, Christoph Hellwig wrote:
> 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>
Heh, whoops.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> 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
>
>
next prev parent reply other threads:[~2024-08-14 5:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Darrick J. Wong [this message]
-- 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 1/2] xfs: remove a stale comment in xfs_ioc_trim Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240814051247.GD865349@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox