From: Mark Korenberg <socketpair@gmail.com>
To: "Martin Škoda" <mar.skoda@gmail.com>
Cc: johannes.thumshirn@wdc.com, a2jphilipp@gmail.com,
dsterba@suse.com, linux-btrfs@vger.kernel.org,
naohiro.aota@wdc.com, zhudongjiang@fygo.io
Subject: Re: [PATCH v3] btrfs: zoned: don't release active zone reservations for conventional zones
Date: Mon, 16 Nov 2026 20:08:37 +0500 [thread overview]
Message-ID: <d8a44fc376348da4febd9bef5d279fb1@gmail.com> (raw)
In-Reply-To: <e3261fe5-4b98-47e6-ae66-d4af05caa621@gmail.com>
On Fri, Nov 13, 2026 at 05:16:50PM +0100, Martin Škoda wrote:
> On kernel 7.0.0-42, writing large media files repeatedly produced:
>
> BTRFS error (device sdg): cow_file_range failed ...: -28
> BTRFS error (device sdg): failed to run delalloc range ...: -28
>
> These errors occurred despite several TiB of free space being
> reported.
Note that these two messages mean lost data, not just a failed write:
cow_file_range() ends the writeback of the range without writing it
and only sets an error on the mapping. write() and close() succeed,
and only the next fsync() or syncfs() returns -ENOSPC. Files written
around the time of the messages can differ on disk even if they read
back fine while their pages are still cached, so it is worth comparing
them with their sources after "echo 3 > /proc/sys/vm/drop_caches".
On zoned btrfs we hit exactly this when reserved_active_zones goes
negative. btrfs_can_activate_zone() then reports a free active zone
for data although none is left, so the allocator neither finishes a
zone nor waits for one, and find_free_extent() returns -ENOSPC. The
conventional zone accounting fixed by this patch and by Dongjiang's
series is one way for the reservation to go negative; relocating a
metadata or system block group with balance is another one.
I posted a series for this:
https://lore.kernel.org/r/20261104-btrfs-zoned-active-zone-leak-v2-0-0cee2ef72171@gmail.com
Patch 2 treats a negative reservation as zero for data, so writeback
finishes a zone or waits instead of failing, whatever made the
reservation negative. Patch 1 fixes the leak by balance. Both are
marked for stable 7.0 and later. They apply without conflicts on
current for-next and on top of Dongjiang's zoned-fixes-testing branch;
that branch fixes other sources of the negative reservation, but not
the one from balance, and doesn't change the check for data.
> Could you confirm whether these symptoms match the active-zone
> reservation/accounting issue addressed by this patch series?
For the -ENOSPC in writeback I think so, but from here I can't tell
which of the sources above made the reservation negative on your
filesystem.
Thanks,
Mark
prev parent reply other threads:[~2026-11-16 15:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 8:09 [PATCH v3] btrfs: zoned: don't release active zone reservations for conventional zones Johannes Thumshirn
2026-11-10 15:08 ` Jochen Philipp
2026-11-13 10:09 ` Dongjiang Zhu
2026-11-13 10:14 ` Jochen Philipp
2026-11-13 12:40 ` Jochen Philipp
2026-11-13 14:00 ` Jochen Philipp
2026-11-13 14:45 ` Johannes Thumshirn
2026-11-13 14:55 ` Jochen Philipp
2026-11-13 16:16 ` Martin Škoda
2026-11-13 17:13 ` Jochen Philipp
2026-11-16 6:59 ` Johannes Thumshirn
2026-11-16 8:56 ` Dongjiang Zhu
2026-11-16 15:08 ` Mark Korenberg [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=d8a44fc376348da4febd9bef5d279fb1@gmail.com \
--to=socketpair@gmail.com \
--cc=a2jphilipp@gmail.com \
--cc=dsterba@suse.com \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mar.skoda@gmail.com \
--cc=naohiro.aota@wdc.com \
--cc=zhudongjiang@fygo.io \
/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