Re: [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when discard_cmd_cnt is 0 in f2fs_put_super()

From: Chao Yu
Date: Mon Dec 12 2022 - 09:34:53 EST


On 2022/12/12 22:14, Yangtao Li wrote:
Hi Chao,

The difference here is, if we use f2fs_realtime_discard_enable() in
f2fs_put_super(), we will only write checkpoint w/ CP_TRIMMED flag
when discard option is enable and device supports discard.

But actually, if discard option is disabled, we still needs to give
put_super() a chance to write checkpoint w/ CP_TRIMMED flag.

Why do we still have to set the CP_TRIMMED flag when the discard opt is not set.
Did I miss something?

Hi Yangtao,

I guess it's up to scenario. e.g.

mount w/ nodiscard and use FITRIM to trigger in-batch discard,
if we set CP_TRIMMED flag during umount, next time, after mount
w/ discard, it doesn't to issue redundant discard.

Thanks,


Thx,
Yangtao