From: Chengming Zhou <chengming.zhou@linux.dev>
To: Friedrich Weber <f.weber@proxmox.com>,
axboe@kernel.dk, ming.lei@redhat.com, hch@lst.de,
bvanassche@acm.org
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
zhouchengming@bytedance.com,
Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [PATCH] block: fix request.queuelist usage in flush
Date: Fri, 7 Jun 2024 10:37:58 +0800 [thread overview]
Message-ID: <dea87c0a-1c36-4737-bea5-cb7fa273b724@linux.dev> (raw)
In-Reply-To: <343166f4-ac11-4f0e-ad13-6dc14dbf573d@proxmox.com>
On 2024/6/6 16:44, Friedrich Weber wrote:
> On 05/06/2024 16:27, Chengming Zhou wrote:
>> On 2024/6/5 21:34, Friedrich Weber wrote:
>>> On 05/06/2024 12:54, Friedrich Weber wrote:
>>> [...]
>>>
>>> My results:
>>>
>>> Booting the Debian (virtual) machine with mainline kernel v6.10-rc2
>>> (c3f38fa61af77b49866b006939479069cd451173):
>>> works fine, no crash
>>>
>>> Booting the Debian (virtual) machine with patch "block: fix
>>> request.queuelist usage in flush" applied on top of v6.10-rc2: The
>>> Debian (virtual) machine crashes during boot with [1].
>>>
>>> Hope this helps! If I can provide anything else, just let me know.
>>
>> Thanks for your help, I still can't reproduce it myself, don't know why.
>
> Weird -- when booting the Debian machine into mainline kernel v6.10-rc2
> with "block: fix request.queuelist usage in flush" applied on top, it
> crashes reliably for me. The machine having its root on LVM seems to be
> essential to reproduce the crash, though.
Yeah, right, it seems LVM may create this special request that only has
PREFLUSH | POSTFLUSH without any DATA, goes into the flush state machine.
Then, cause the request double list_add_tail() without list_del_init().
I don't know the reason behind it, but well, it's allowable in the current
flush code.
>
> Maybe the fact that I'm running the Debian machine virtualized makes the
> crash more likely to trigger. I'll try to reproduce on bare metal to
> narrow down the reproducer and get back to you.
Thanks much for your very detailed process on that thread!
>
>> Could you help to test with this diff?
>>
>> diff --git a/block/blk-flush.c b/block/blk-flush.c
>> index e7aebcf00714..cca4f9131f79 100644
>> --- a/block/blk-flush.c
>> +++ b/block/blk-flush.c
>> @@ -263,6 +263,7 @@ static enum rq_end_io_ret flush_end_io(struct request *flush_rq,
>> unsigned int seq = blk_flush_cur_seq(rq);
>>
>> BUG_ON(seq != REQ_FSEQ_PREFLUSH && seq != REQ_FSEQ_POSTFLUSH);
>> + list_del_init(&rq->queuelist);
>> blk_flush_complete_seq(rq, fq, seq, error);
>> }
>
> I used mainline kernel v6.10-rc2 as base and applied:
>
> - "block: fix request.queuelist usage in flush"
> - Your `list_del_init` addition from above
>
> and if I boot the Debian machine into this kernel, I do not get the
> crash anymore.
Good to hear. So can I merge these two diffs into one patch and add
your Tested-by?
>
> Happy to run more tests for you, just let me know.
Thanks again!
next prev parent reply other threads:[~2024-06-07 2:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 6:47 [PATCH] block: fix request.queuelist usage in flush Chengming Zhou
2024-06-04 14:17 ` Jens Axboe
2024-06-05 18:14 ` Jens Axboe
2024-06-05 8:45 ` Friedrich Weber
2024-06-05 10:30 ` Chengming Zhou
2024-06-05 10:54 ` Friedrich Weber
2024-06-05 13:34 ` Friedrich Weber
2024-06-05 14:27 ` Chengming Zhou
2024-06-06 8:44 ` Friedrich Weber
2024-06-06 16:05 ` Friedrich Weber
2024-06-07 2:37 ` Chengming Zhou [this message]
2024-06-07 4:55 ` Christoph Hellwig
2024-06-07 6:24 ` Chengming Zhou
2024-06-07 6:31 ` Christoph Hellwig
2024-06-07 6:33 ` Chengming Zhou
2024-06-07 15:13 ` Friedrich Weber
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=dea87c0a-1c36-4737-bea5-cb7fa273b724@linux.dev \
--to=chengming.zhou@linux.dev \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=f.weber@proxmox.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=t.lamprecht@proxmox.com \
--cc=zhouchengming@bytedance.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