mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: chao@kernel.org, jaegeuk@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix to clear unusable_cap for checkpoint=enable
Date: Fri, 8 Aug 2025 12:14:33 +0800	[thread overview]
Message-ID: <b8470c47-4fc2-48da-b93d-cb469638fb43@kernel.org> (raw)
In-Reply-To: <CAHJ8P3Krr4pCdOmnSJ6mp5bfGLLH4TJqd0FC7Qiw2V3iEL5VEw@mail.gmail.com>

On 8/8/2025 9:07 AM, Zhiguo Niu wrote:
> Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
> 于2025年8月7日周四 09:52写道:
>>
>> mount -t f2fs -o checkpoint=disable:10% /dev/vdb /mnt/f2fs/
>> mount -t f2fs -o remount,checkpoint=enable /dev/vdb /mnt/f2fs/
>>
>> kernel log:
>> F2FS-fs (vdb): Adjust unusable cap for checkpoint=disable = 204440 / 10%
>>
>> If we has assigned checkpoint=enable mount option, unusable_cap{,_perc}
>> parameters of checkpoint=disable should be reset, then calculation and
>> log print could be avoid in adjust_unusable_cap_perc().
>>
>> Fixes: 1ae18f71cb52 ("f2fs: fix checkpoint=disable:%u%%")
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>>   fs/f2fs/super.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index f37004780ce0..c1f45df9efec 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -1014,6 +1014,10 @@ static int f2fs_parse_param(struct fs_context *fc, struct fs_parameter *param)
>>                          ctx_set_opt(ctx, F2FS_MOUNT_DISABLE_CHECKPOINT);
>>                          break;
>>                  case Opt_checkpoint_enable:
>> +                       F2FS_CTX_INFO(ctx).unusable_cap_perc = 0;
>> +                       ctx->spec_mask |= F2FS_SPEC_checkpoint_disable_cap_perc;
>> +                       F2FS_CTX_INFO(ctx).unusable_cap = 0;
>> +                       ctx->spec_mask |= F2FS_SPEC_checkpoint_disable_cap;
> Hi Chao,
> when enable checkpoint, shoud it be:
> ctx->spec_mask &= ~F2FS_SPEC_checkpoint_disable_cap_perc;
> ctx->spec_mask &= ~F2FS_SPEC_checkpoint_disable_cap;
> please correct me if I misunderstanding.

Zhiguo,

IMO, F2FS_SPEC_checkpoint_disable_cap_perc or F2FS_SPEC_checkpoint_disable_cap
flags can be added to ctx->spec_mask to indicate ctx.unusable_cap_perc or
ctx.unusable_cap has been updated, then we can store last parameter value from
ctx to sbi in f2fs_apply_options() as below:

	if (ctx->spec_mask & F2FS_SPEC_checkpoint_disable_cap)
		F2FS_OPTION(sbi).unusable_cap = F2FS_CTX_INFO(ctx).unusable_cap;
	if (ctx->spec_mask & F2FS_SPEC_checkpoint_disable_cap_perc)
		F2FS_OPTION(sbi).unusable_cap_perc =
					F2FS_CTX_INFO(ctx).unusable_cap_perc;

Or am I missing something here?

Thanks,

> thanks!
>>                          ctx_clear_opt(ctx, F2FS_MOUNT_DISABLE_CHECKPOINT);
>>                          break;
>>                  default:
>> --
>> 2.49.0
>>
>>
>>
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


  reply	other threads:[~2025-08-08  4:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07  1:48 Chao Yu
2025-08-08  1:07 ` [f2fs-dev] " Zhiguo Niu
2025-08-08  4:14   ` Chao Yu [this message]
2025-08-08  5:37     ` Zhiguo Niu
2025-08-15 16:40 ` patchwork-bot+f2fs

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=b8470c47-4fc2-48da-b93d-cb469638fb43@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niuzhiguo84@gmail.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

all inboxes | Powered by JetHome®