From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Daniel Vacek <neelx@suse.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Omar Sandoval <osandov@fb.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-rt-devel@lists.linux.dev" <linux-rt-devel@lists.linux.dev>
Subject: Re: [PATCH] btrfs: fix a race in encoded read
Date: Thu, 12 Dec 2024 09:13:55 +0000 [thread overview]
Message-ID: <9d5b4776-e3c8-449c-bb0d-c200a1f76603@wdc.com> (raw)
In-Reply-To: <CAPjX3FchmM24-Afv7ueeK-Z1zBYivfj4yKXhVq6bARiGjqQOwQ@mail.gmail.com>
On 12.12.24 10:08, Daniel Vacek wrote:
> On Thu, Dec 12, 2024 at 10:02 AM Johannes Thumshirn
> <Johannes.Thumshirn@wdc.com> wrote:
>>
>> On 12.12.24 09:53, Daniel Vacek wrote:
>>> On Thu, Dec 12, 2024 at 9:35 AM Johannes Thumshirn
>>> <Johannes.Thumshirn@wdc.com> wrote:
>>>>
>>>> On 12.12.24 09:09, Daniel Vacek wrote:
>>>>> Hi Johannes,
>>>>>
>>>>> On Thu, Dec 12, 2024 at 9:00 AM Johannes Thumshirn
>>>>> <Johannes.Thumshirn@wdc.com> wrote:
>>>>>>
>>>>>> On 12.12.24 08:54, Daniel Vacek wrote:
>>>>>>> While testing the encoded read feature the following crash was observed
>>>>>>> and it can be reliably reproduced:
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Daniel,
>>>>>>
>>>>>> This suspiciously looks like '05b36b04d74a ("btrfs: fix use-after-free
>>>>>> in btrfs_encoded_read_endio()")'. Do you have this patch applied to your
>>>>>> kernel? IIRC it went upstream with 6.13-rc2.
>>>>>
>>>>> Yes, I do. This one is on top of it. The crash happens with
>>>>> `05b36b04d74a` applied. All the crashes were reproduced with
>>>>> `feffde684ac2`.
>>>>>
>>>>> Honestly, `05b36b04d74a` looks a bit suspicious to me as it really
>>>>> does not look to deal correctly with the issue to me. I was a bit
>>>>> surprised/puzzled.
>>>>
>>>> Can you elaborate why?
>>>
>>> As it only touches one of those four atomic_dec_... lines. In theory
>>> the issue can happen also on the two async places, IIUC. It's only a
>>> matter of race probability.
>>>
>>>>> Anyways, I could reproduce the crash in a matter of half an hour. With
>>>>> this fix the torture is surviving for 22 hours atm.
>>>>
>>>> Do you also have '3ff867828e93 ("btrfs: simplify waiting for encoded
>>>> read endios")'? Looking at the diff it doesn't seems so.
>>>
>>> I cannot find that one. Am I missing something? Which repo are you using?
>>
>> The for-next branch for btrfs [1], which is what ppl developing against
>> btrfs should use. Can you please re-test with it and if needed re-base
>> your patch on top of it?
>>
>> [1] https://github.com/btrfs/linux for-next
>
> I did check here and I don't really see the commit.
>
> $ git remote -v
> origin https://github.com/btrfs/linux.git (fetch)
> origin https://github.com/btrfs/linux.git (push)
> $ git fetch
> $ git show 3ff867828e93 --
> fatal: bad revision '3ff867828e93'
>
> Note, I was testing v6.13-rc1. This is a fix not a feature development.
It got recently force pushed, 34725028ec5500018f1cb5bfd55c669c7bbf1346
it is now, sorry.
next prev parent reply other threads:[~2024-12-12 9:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 7:53 Daniel Vacek
2024-12-12 8:00 ` Johannes Thumshirn
2024-12-12 8:16 ` Daniel Vacek
2024-12-12 8:53 ` Daniel Vacek
2024-12-12 9:02 ` Johannes Thumshirn
2024-12-12 9:08 ` Daniel Vacek
2024-12-12 9:13 ` Johannes Thumshirn [this message]
2024-12-12 9:34 ` Daniel Vacek
2024-12-12 10:10 ` Johannes Thumshirn
2024-12-12 10:26 ` Daniel Vacek
2024-12-12 19:07 ` David Sterba
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=9d5b4776-e3c8-449c-bb0d-c200a1f76603@wdc.com \
--to=johannes.thumshirn@wdc.com \
--cc=bigeasy@linutronix.de \
--cc=clm@fb.com \
--cc=clrkwllms@kernel.org \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=neelx@suse.com \
--cc=osandov@fb.com \
--cc=rostedt@goodmis.org \
--cc=stable@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
all inboxes | Powered by JetHome®