lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Dec 2022 09:32:09 +0800
From:   Chao Yu <chao@...nel.org>
To:     Jaegeuk Kim <jaegeuk@...nel.org>
Cc:     Yangtao Li <frank.li@...o.com>,
        linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] f2fs: don't call f2fs_issue_discard_timeout() when
 discard_cmd_cnt is 0 in f2fs_put_super()

On 2022/12/13 6:45, Jaegeuk Kim wrote:
> On 12/12, Chao Yu wrote:
>> 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.
> 
> If fitrim was called with a range, we can get a wrong FI_TRIMMED flag. Isn't it

We can set CP_TRIMMED flag only if fitrim was called on full range w/ 4k granularity,
due to it will check sbi->discard_blks variable to make sure there is no range we
haven't trimmed.

> better to get a full discard range after remount even though some are redundant?

If nodiscard is set, and sbi->discard_blks becomes zero, it says a full range fitrim
was been triggered.

So, previous check condition has no problem, right?

	if ((f2fs_hw_support_discard(sbi) || f2fs_hw_should_discard(sbi)) &&
					!sbi->discard_blks && !dropped) {

Thanks,

> 
>>
>> Thanks,
>>
>>>
>>> Thx,
>>> Yangtao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ