From: Chao Yu <chao@kernel.org>
To: Chao Yu <yuchao0@huawei.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: fix to return correct trimmed block number in FITRIM interface
Date: Thu, 7 Jul 2016 12:29:02 +0800 [thread overview]
Message-ID: <f72ddb05-7d92-e2aa-94c3-6757dfb28152@kernel.org> (raw)
In-Reply-To: <20160630084248.57469-1-yuchao0@huawei.com>
Hi all,
I think this patch should be wrong, since during fstrim, we should not issue
discard for prefree segment redundantly.
So, Jaegeuk, could you please drop this patch in your branch?
Sorry for the noise.
Thanks,
On 2016/6/30 16:42, Chao Yu wrote:
> During tiggering fstrim, in case of issuing discard for prefree segments,
> we miss acclumulating trimmed block number which will be return to user.
> Fix it.
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/segment.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 6d16ecf..5dc14d6 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -732,15 +732,20 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
> if (!test_opt(sbi, LFS) || sbi->segs_per_sec == 1) {
> f2fs_issue_discard(sbi, START_BLOCK(sbi, start),
> (end - start) << sbi->log_blocks_per_seg);
> + cpc->trimmed +=
> + (end - start) << sbi->log_blocks_per_seg;
> continue;
> }
> next:
> secno = GET_SECNO(sbi, start);
> start_segno = secno * sbi->segs_per_sec;
> if (!IS_CURSEC(sbi, secno) &&
> - !get_valid_blocks(sbi, start, sbi->segs_per_sec))
> + !get_valid_blocks(sbi, start, sbi->segs_per_sec)) {
> f2fs_issue_discard(sbi, START_BLOCK(sbi, start_segno),
> sbi->segs_per_sec << sbi->log_blocks_per_seg);
> + cpc->trimmed +=
> + sbi->segs_per_sec << sbi->log_blocks_per_seg;
> + }
>
> start = start_segno + sbi->segs_per_sec;
> if (start < end)
>
prev parent reply other threads:[~2016-07-07 4:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 8:42 [PATCH 1/2] f2fs: fix to return correct trimmed block number in FITRIM interface Chao Yu
2016-06-30 8:42 ` [PATCH 2/2] f2fs: fix to avoid data update racing between GC and DIO Chao Yu
2016-07-01 0:03 ` Jaegeuk Kim
2016-07-01 6:03 ` Chao Yu
2016-07-06 0:24 ` Jaegeuk Kim
2016-07-06 2:10 ` Chao Yu
2016-07-06 22:37 ` Jaegeuk Kim
2016-07-07 4:25 ` [f2fs-dev] " Chao Yu
2016-07-07 4:29 ` Chao Yu [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=f72ddb05-7d92-e2aa-94c3-6757dfb28152@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yuchao0@huawei.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