From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Seongjae Jeong <jsjlee1020@gmail.com>
Cc: jaegeuk@kernel.org, yi.sun@unisoc.com,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: skip further SIT updates for already invalidated blocks
Date: Fri, 13 Nov 2026 17:31:21 +0800 [thread overview]
Message-ID: <86627f3f-cdda-4165-8ca2-0c8dd4e321a9@kernel.org> (raw)
In-Reply-To: <CAPHXVrxHvXChxiBxCcHWLaFwvatnDVhSu7wdvPWiBDYaUSOQJg@mail.gmail.com>
Hi Seongjae,
On 11/12/26 18:36, Seongjae Jeong wrote:
>> I don't see how commit a66cdd985532 ("f2fs: introduce discard_map for f2fs_trim_fs")
>> introduce the bug? from the timeline, at that point there is no error handling in
>> update_sit_entries() if sit bitmap is inconsistent, right?
>>
>
> Hi Chao,
>
> Commit a66cdd985532 added the following two lines:
>
> if (!f2fs_test_and_clear_bit(offset, se->cur_valid_map))
> f2fs_bug_on(sbi, 1);
Previously, we will trigger f2fs_bug_on() and there is no further error handling
at that point, so that we will update SIT_I(sbi)->written_valid_blocks as well
incorrectly, so I don't think this is a bug of a66cdd985532.
Thanks,
> + if (f2fs_test_and_clear_bit(offset, se->discard_map))
> + sbi->discard_blks++;
>
> Even if the cur_valid_map bit was already clear, the added code
> could still clear the discard bit and increment discard_blks if the
> discard bit was set.
>
> Since my patch skips that update for an already invalidated block,
> I thought a66cdd985532 was an appropriate Fixes tag for the discard
> bitmap part of the change.
>
> Thanks,
> Seongjae
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Seongjae Jeong <jsjlee1020@gmail.com>
Cc: chao@kernel.org, jaegeuk@kernel.org, yi.sun@unisoc.com,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: skip further SIT updates for already invalidated blocks
Date: Fri, 13 Nov 2026 17:31:21 +0800 [thread overview]
Message-ID: <86627f3f-cdda-4165-8ca2-0c8dd4e321a9@kernel.org> (raw)
In-Reply-To: <CAPHXVrxHvXChxiBxCcHWLaFwvatnDVhSu7wdvPWiBDYaUSOQJg@mail.gmail.com>
Hi Seongjae,
On 11/12/26 18:36, Seongjae Jeong wrote:
>> I don't see how commit a66cdd985532 ("f2fs: introduce discard_map for f2fs_trim_fs")
>> introduce the bug? from the timeline, at that point there is no error handling in
>> update_sit_entries() if sit bitmap is inconsistent, right?
>>
>
> Hi Chao,
>
> Commit a66cdd985532 added the following two lines:
>
> if (!f2fs_test_and_clear_bit(offset, se->cur_valid_map))
> f2fs_bug_on(sbi, 1);
Previously, we will trigger f2fs_bug_on() and there is no further error handling
at that point, so that we will update SIT_I(sbi)->written_valid_blocks as well
incorrectly, so I don't think this is a bug of a66cdd985532.
Thanks,
> + if (f2fs_test_and_clear_bit(offset, se->discard_map))
> + sbi->discard_blks++;
>
> Even if the cur_valid_map bit was already clear, the added code
> could still clear the discard bit and increment discard_blks if the
> discard bit was set.
>
> Since my patch skips that update for an already invalidated block,
> I thought a66cdd985532 was an appropriate Fixes tag for the discard
> bitmap part of the change.
>
> Thanks,
> Seongjae
next prev parent reply other threads:[~2026-11-13 9:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 6:10 [f2fs-dev] [PATCH] f2fs: skip further SIT updates for already invalidated blocks Seongjae Jeong
2026-10-04 6:10 ` Seongjae Jeong
2026-10-11 8:16 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-10-11 8:16 ` Chao Yu
2026-10-11 10:39 ` [f2fs-dev] " Seongjae Jeong
2026-10-11 10:39 ` Seongjae Jeong
2026-11-11 9:04 ` Chao Yu
2026-11-11 9:04 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-12 3:48 ` Seongjae Jeong
2026-11-12 3:48 ` [f2fs-dev] " Seongjae Jeong
2026-11-12 8:30 ` Chao Yu
2026-11-12 8:30 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-11-12 10:36 ` Seongjae Jeong
2026-11-12 10:36 ` Seongjae Jeong
2026-11-13 9:31 ` Chao Yu via Linux-f2fs-devel [this message]
2026-11-13 9:31 ` Chao Yu
2026-11-13 10:33 ` [f2fs-dev] " Seongjae Jeong
2026-11-13 10:33 ` Seongjae Jeong
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=86627f3f-cdda-4165-8ca2-0c8dd4e321a9@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=jsjlee1020@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yi.sun@unisoc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.