From: Chao Yu <chao@kernel.org>
To: Wenjie Qi <qwjhust@gmail.com>, jaegeuk@kernel.org
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com
Subject: Re: [PATCH v3 2/2] f2fs: protect critical_task_priority updates with s_umount
Date: Tue, 4 Aug 2026 08:04:25 +0800 [thread overview]
Message-ID: <fdf53428-4ed6-46a2-b256-f7933aaccb86@kernel.org> (raw)
In-Reply-To: <20260803123251.1522864-2-qiwenjie@xiaomi.com>
On 8/3/26 20:32, Wenjie Qi wrote:
> The sysfs store path already takes s_umount for GC thread control
> entries, and ckpt_thread_ioprio is covered as well.
>
> critical_task_priority also updates checkpoint or GC kthread scheduling
> state, but it is not covered by that serialization. It can race with
> remount or teardown paths that are stopping those threads.
>
> Protect critical_task_priority sysfs writes with s_umount too.
>
Missing fixes and Cc stable line, otherwise it looks good to me.
> Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
> ---
> v3:
> - split this change out so patch 1 only fixes ckpt_thread_ioprio
> - keep this patch focused on critical_task_priority only
>
> fs/f2fs/sysfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c
> index 0729b3670415..aa1621419932 100644
> --- a/fs/f2fs/sysfs.c
> +++ b/fs/f2fs/sysfs.c
> @@ -1007,7 +1007,8 @@ static ssize_t f2fs_sbi_store(struct f2fs_attr *a,
> ssize_t ret;
> bool gc_entry = (!strcmp(a->attr.name, "gc_urgent") ||
> a->struct_type == GC_THREAD);
> - bool thread_entry = !strcmp(a->attr.name, "ckpt_thread_ioprio");
> + bool thread_entry = !strcmp(a->attr.name, "ckpt_thread_ioprio") ||
> + !strcmp(a->attr.name, "critical_task_priority");
>
> if (gc_entry || thread_entry) {
> if (!down_read_trylock(&sbi->sb->s_umount))
next prev parent reply other threads:[~2026-08-04 0:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 12:32 [PATCH v3 1/2] f2fs: avoid NULL checkpoint thread access in sysfs Wenjie Qi
2026-08-03 12:32 ` [PATCH v3 2/2] f2fs: protect critical_task_priority updates with s_umount Wenjie Qi
2026-08-04 0:04 ` Chao Yu [this message]
2026-08-04 0:03 ` [PATCH v3 1/2] f2fs: avoid NULL checkpoint thread access in sysfs Chao Yu
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=fdf53428-4ed6-46a2-b256-f7933aaccb86@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=qiwenjie@xiaomi.com \
--cc=qwjhust@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®