Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.com>,
	Qu Wenruo <wqu@suse.com>, Naohiro Aota <naohiro.aota@wdc.com>
Subject: Re: [PATCH v2 0/2] btrfs-progs: fix stale active zone after mkfs
Date: Mon, 14 Sep 2026 19:40:12 +0200	[thread overview]
Message-ID: <20260914174012.GR54722@twin.jikos.cz> (raw)
In-Reply-To: <20260904062444.3467618-1-johannes.thumshirn@wdc.com>

On Fri, Sep 04, 2026 at 08:24:42AM +0200, Johannes Thumshirn wrote:
> On zoned devices, mkfs can leave a stale zone behind that is used as a
> staging area but never reset. This zone is not backed by a chunk or
> device extent, so the FS itself does not account it as used. On devices
> that have a limitied active zone budget this can lead to premature
> ENOSPC and/or an exhaustion of active zones.
> 
> Fix it in mkfs for new file-systems and also add a check to fsck to find
> such zones and repair them with '--repair'.
> 
> Changes to v1:
> - fix a bug in fsck where it had a stale return value propagated.
> 
> Johannes Thumshirn (2):
>   btrfs-progs: zoned: refresh stale cached zone state in
>     btrfs_reset_dev_zone()
>   btrfs-progs: check: detect leaked active zones on zoned devices

The build fails on older distros (Centos 8, Leap 15.3/16.0):

  CC       check/main.o
check/main.c: In function 'check_zoned_active_zones':
check/main.c:9220:12: error: 'struct blk_zone' has no member named 'type'
    if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL)
            ^~
check/main.c:9220:22: error: 'BLK_ZONE_TYPE_CONVENTIONAL' undeclared (first use in this function)
    if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
check/main.c:9220:22: note: each undeclared identifier is reported only once for each function it appears in
check/main.c:9222:12: error: 'struct blk_zone' has no member named 'cond'
    if (zone->cond == BLK_ZONE_COND_EMPTY)
            ^~
check/main.c:9222:22: error: 'BLK_ZONE_COND_EMPTY' undeclared (first use in this function)
    if (zone->cond == BLK_ZONE_COND_EMPTY)
                      ^~~~~~~~~~~~~~~~~~~

The types were added in f5f2bad67a45 ("block: make the new blkzoned UAPI
constants discoverable") in 2016 and with the rest of the zoned userspace code
so it's not something recent.

I haven't looked what's the problem, this should be reproducible locally using
the "ci/ci-centos8" scripts (needs docker).

  parent reply	other threads:[~2026-09-14 17:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  6:24 [PATCH v2 0/2] btrfs-progs: fix stale active zone after mkfs Johannes Thumshirn
2026-09-04  6:24 ` [PATCH v2 1/2] btrfs-progs: zoned: refresh stale cached zone state in btrfs_reset_dev_zone() Johannes Thumshirn
2026-09-04  6:24 ` [PATCH v2 2/2] btrfs-progs: check: detect leaked active zones on zoned devices Johannes Thumshirn
2026-09-14 17:27 ` [PATCH v2 0/2] btrfs-progs: fix stale active zone after mkfs David Sterba
2026-09-14 17:40 ` David Sterba [this message]
2026-09-14 19:55   ` David Sterba
2026-09-14 20:26     ` 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=20260914174012.GR54722@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.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