From: Yuanheng Zhang <yuanhengzhang1214@gmail.com>
To: mark@fasheh.com
Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
Yuanheng Zhang <yuanhengzhang1214@gmail.com>
Subject: [PATCH] ocfs2: correct range->len in ocfs2_trim_fs()
Date: Mon, 28 Aug 2023 13:17:41 +0800 [thread overview]
Message-ID: <20230828051741.204577-1-yuanhengzhang1214@gmail.com> (raw)
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>
---
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;
}
--
2.34.1
next reply other threads:[~2023-08-28 5:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 5:17 Yuanheng Zhang [this message]
2023-08-29 8:27 ` [PATCH] ocfs2: correct range->len in ocfs2_trim_fs() Joseph Qi
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=20230828051741.204577-1-yuanhengzhang1214@gmail.com \
--to=yuanhengzhang1214@gmail.com \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
/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).