From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Ginger <ginger.jzllee@gmail.com>, clm@fb.com
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [bug report] Potential atomicity bug in fs/btrfs/compression.c, between btrfs_put_workspace() and free_workspace_manager()
Date: Thu, 23 Apr 2026 15:59:12 +0930 [thread overview]
Message-ID: <99c9e1c0-5b85-4f9f-89e1-65797758d36b@gmx.com> (raw)
In-Reply-To: <CAGp+u1YSz4vO_zOgY63Y7bw499Wtez++HuNLZVnjUGkwLihQTQ@mail.gmail.com>
在 2026/4/23 14:25, Ginger 写道:
> Dear Linux kernel maintainers,
>
> My research-based static analyzer found a potential atomicity bug
> within the 'fs/btrfs' subsystem, more specifically, in
> 'fs/btrfs/compression.c'.
I guess your "research-based static analyzer" is some pretty bad LLM.
>
> Kernel version: long-term kernel v6.18.9
>
> Potential concurrent triggering executions:
> T0:
> btrfs_put_workspace
> --> ws_lock = fs_info->compr_wsm[type]->ws_lock;
> --> spin_lock(ws_lock)
> --> list_add(ws, gwsm->idl_ws)
> --> spin_unlock(ws_lock)
>
> T1:
> free_workspace_manager
> --> gwsm = fs_info->compr_wsm[type];
> --> while(!list_empty(gwsm->idle_ws))
Go check when free_workspace_manager() is called.
At that time there should be no compression workload at all, because
that's when the super block of the fs is being removed.
>
> In T1, the accesses to the idle_ws are plain memory reads and writes,
> without holding the 'ws_lock' to protect against potential data races.
>
> Please kindly check at your convenience. Thank you for your time and
> consideration.
Please kindly switch to a better LLM.
>
> Best regards,
> Ginger
>
prev parent reply other threads:[~2026-04-23 6:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 4:55 [bug report] Potential atomicity bug in fs/btrfs/compression.c, between btrfs_put_workspace() and free_workspace_manager() Ginger
2026-04-23 6:29 ` Qu Wenruo [this message]
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=99c9e1c0-5b85-4f9f-89e1-65797758d36b@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=clm@fb.com \
--cc=ginger.jzllee@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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