From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Yuanheng Zhang <yuanhengzhang1214@gmail.com>,
mark@fasheh.com, akpm <akpm@linux-foundation.org>
Cc: jlbec@evilplan.org, ocfs2-devel@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ocfs2: correct range->len in ocfs2_trim_fs()
Date: Tue, 29 Aug 2023 16:27:06 +0800 [thread overview]
Message-ID: <48e57434-abf9-5e1f-c24e-46a0eb7ddc16@linux.alibaba.com> (raw)
In-Reply-To: <20230828051741.204577-1-yuanhengzhang1214@gmail.com>
On 8/28/23 1:17 PM, Yuanheng Zhang wrote:
> global bitmap is a cluster allocator,so after we traverse
> the global bitmap and finished the fstrim,the trimmed range
> should be 'trimmed * clustersize'.otherwise,the trimmed range
> printed by 'fstrim -v' is not as expected.
>
> Signed-off-by: Yuanheng Zhang <yuanhengzhang1214@gmail.com>
Thanks for pointing this out. It looks fine to me.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index 51c93929a146..bced551240cf 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -7642,7 +7642,7 @@ int ocfs2_trim_mainbm(struct super_block *sb, struct fstrim_range *range)
> goto next_group;
> }
> out:
> - range->len = trimmed * sb->s_blocksize;
> + range->len = trimmed * osb->s_clustersize;
> return ret;
> }
>
prev parent reply other threads:[~2023-08-29 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 5:17 [PATCH] ocfs2: correct range->len in ocfs2_trim_fs() Yuanheng Zhang
2023-08-29 8:27 ` Joseph Qi [this message]
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=48e57434-abf9-5e1f-c24e-46a0eb7ddc16@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=yuanhengzhang1214@gmail.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).