Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: Filipe Manana <fdmanana@suse.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH 2/5] btrfs: zoned: drop stale dirty btree buffers at close_ctree()
Date: Fri, 17 Jul 2026 08:56:59 +0200	[thread overview]
Message-ID: <c65d3e19-fd97-4e88-9a66-30dc77a6d17e@wdc.com> (raw)
In-Reply-To: <062d26d5-c340-4e3b-bf56-a38d1f98a546@suse.com>

On 17.07.26 00:49, Qu Wenruo wrote:
> 在 2026/7/16 21:26, Johannes Thumshirn 写道:
>> On a zoned filesystem btrfs_clear_buffer_dirty() keeps a freed-but-dirty
>> tree block dirty (EXTENT_BUFFER_ZONED_ZEROOUT) so its zero-out keeps the
>> zone write pointer moving. A block left ahead of the block group's
>> meta_write_pointer (e.g. a tree-log block freed before being written) can
>> never be written by btree_writepages() and survives to unmount.
>>
>> close_ctree() stops the endio workqueues before the final iput() of the
>> btree inode but frees the block groups only afterwards. Once the block
>> group is gone btrfs_check_meta_write_pointer() no longer defers the 
>> buffer,
>> so the iput() submits it for writeback; its completion can no longer be
>> queued on the destroyed endio_meta_workers and umount hangs on writeback
>> that never finishes.
> 
> Can we just trigger a btree inode write back for zoned cases?
> 
> That sounds much simpler and less hacky.

Let me see what I can do.

  reply	other threads:[~2026-07-17  6:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 11:56 [PATCH 0/5] btrfs: zoned: fix two deadlocks when runing fstests Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 1/5] btrfs: factor out dirty-clearing part of btrfs_clear_buffer_dirty Johannes Thumshirn
2026-07-16 22:31   ` Qu Wenruo
2026-07-16 11:56 ` [PATCH 2/5] btrfs: zoned: drop stale dirty btree buffers at close_ctree() Johannes Thumshirn
2026-07-16 22:49   ` Qu Wenruo
2026-07-17  6:56     ` Johannes Thumshirn [this message]
2026-07-17 14:17     ` Johannes Thumshirn
2026-07-17 22:45       ` Qu Wenruo
2026-07-16 11:56 ` [PATCH 3/5] btrfs: walk waited ordered extents in place Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 4/5] btrfs: walk waited ordered roots " Johannes Thumshirn
2026-07-16 11:56 ` [PATCH 5/5] btrfs: zoned: avoid ordered_operations_mutex when finishing a zone Johannes Thumshirn

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=c65d3e19-fd97-4e88-9a66-30dc77a6d17e@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=dlemoal@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --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