From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Melon Liu <melon1335@163.com>, Qu Wenruo <wqu@suse.com>
Cc: clm@fb.com, dsterba@suse.com, fdmanana@suse.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix deadlocks with transaction commit when cloning inline extents
Date: Mon, 31 Aug 2026 08:05:16 +0930 [thread overview]
Message-ID: <9a5f0b52-a363-4b7f-a207-677fa6938cac@gmx.com> (raw)
In-Reply-To: <byfdpkxktwidszfv3yss7nxajjioxq7nhcmnxrzrwkvvzqaejh@ovl6qwbe6du6>
在 2026/8/30 20:12, Melon Liu 写道:
> On Sat, Aug 29, 2026 at 06:25:11PM +0930, Qu Wenruo wrote:
>>
>>
>> 在 2026/8/29 17:09, Melon Liu 写道:
>>> Commits b48c980b6a7e ("btrfs: fix deadlock between reflink and transaction
>>> commit when using flushoncommit") and 532085d00eb5 ("btrfs: fix deadlock
>>> cloning inline extent when using flushoncommit") moved the destination
>>> i_size update before btrfs_start_transaction() to prevent
>>> extent_writepage() from invalidating a folio beyond EOF. However, two
>>> deadlock windows remain.
>>>
>>> First, after the folio is dirtied but before i_size is updated,
>>> extent_writepage() can still see the folio beyond EOF. It calls
>>> folio_invalidate(), and btrfs_invalidate_folio() waits for the destination
>>> extent range lock held by the clone task.
>>>
>>> Second, if extent_writepage() sees the folio within EOF, it proceeds to
>>> writepage_delalloc(), which also waits for the destination extent range
>>> lock.
>>
>> What about letting the agent to create a reproducer, trigger it and paste
>> the lockdep/hang calltrace?
>>
>> Also an ASCII chart showing the window between involved threads?
>>
[...]
>>> Fixes: 05a5a7621ce6 ("Btrfs: implement full reflink support for inline extents")
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Melon Liu <melon1335@163.com>
>>
>> And AI disclosure.
>>
> Thanks for the review. I'll address your comments and send a v2.
And also check the sashiko review:
https://sashiko.dev/#/patchset/a74ov5nvs5u4nkqhrs5lp2jaj664wewkqqsjxzhuemzazzmzvx%40eeof6sjb3xdc
next prev parent reply other threads:[~2026-08-30 22:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 7:39 [PATCH] btrfs: fix deadlocks with transaction commit when cloning inline extents Melon Liu
2026-08-29 8:55 ` Qu Wenruo
2026-08-30 10:42 ` Melon Liu
2026-08-30 22:35 ` Qu Wenruo [this message]
2026-09-04 15:13 ` Melon Liu
2026-08-31 10:52 ` Filipe Manana
2026-09-04 15:34 ` Melon Liu
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=9a5f0b52-a363-4b7f-a207-677fa6938cac@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=melon1335@163.com \
--cc=stable@vger.kernel.org \
--cc=wqu@suse.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