From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AAED2E414 for ; Tue, 4 Aug 2026 00:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785801869; cv=none; b=WUl7zPlE4Qx6FLpFhsul0xnqpJwq9Ihv9kStCYdYtz4AaOVz5OxdEmMt4p3PLsLj3TdLrooAIq2oZciG0q20vKDOd6uH6x153XKnQ0vLbpi8kqdq1zhRbsfchlrJGhJ8QD5yi9D7ROTbqNwqW+BqthvGeeIjVpPyGrmTg+8YJiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785801869; c=relaxed/simple; bh=GjDe+J++jGltWUGLLbesEBmMifoVxVCHsZGsetvcA7M=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=umjowAisz+jopUsoJVS1M6tX84MfIYWHI2J8NqZU3jr4B7fhOhzMQXBcLrZM1q6SD/Teox0Wa+tMgK1z3gfkxQFu7EzXL/H1A1pI5Xb/B/ZcjepkFvVE+j8BjHtuEQP632EK4254GvqCwnkmNyBiH0XfykutJZuixqHlVYVUo5o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=abVAGg8Z; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="abVAGg8Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D47C31F000E9; Tue, 4 Aug 2026 00:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785801868; bh=SnnYk1JHQwOvbacpIeV4zVA9juApMtgPEyOVr7ifN8g=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=abVAGg8Zm8mz9GXZcTTqixQbGiNcicni0cnj8rxiTVr6C3yp+pJ2lvVo4EuvQ0RBo Ws2yciw2s/nR9GCh1b+WFfbKQ1se4ow3ud06h3NoFdk3WEMjnGrQrQUstzjfFPq3lj l506zqUiZzhuizrE+bCpiFtgPxM5O5q7uTf8Uu/Av697v4cocPvegxZOk8ybtzA2ZO cIUWdbkoRuuNIECQ3EzhtXFDroZEusAPskSaQmxbDVmieBNrjCZCy3AMklqPYK+aK7 JryICpkMOXLkLaI/O3uss/RPBa8bru7dhhFl7bJVIM62+Pr3jmZrvso6boePk4m1wd OAsGJO/+hggrQ== Message-ID: Date: Tue, 4 Aug 2026 08:04:25 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird 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 To: Wenjie Qi , jaegeuk@kernel.org References: <20260803123251.1522864-1-qiwenjie@xiaomi.com> <20260803123251.1522864-2-qiwenjie@xiaomi.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260803123251.1522864-2-qiwenjie@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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))