All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naohiro Aota" <Naohiro.Aota@wdc.com>
To: "Dongjiang Zhu" <zhudongjiang@fygo.io>, <linux-btrfs@vger.kernel.org>
Cc: <johannes.thumshirn@wdc.com>, <naohiro.aota@wdc.com>
Subject: Re: [PATCH v3 1/4] btrfs: zoned: track only sequential zones as active
Date: Fri, 28 Aug 2026 14:26:45 +0900	[thread overview]
Message-ID: <DL0BTAQXFKLH.HG7IL0GTHTK0@wdc.com> (raw)
In-Reply-To: <42a6a9e084182733b61a9d3dd66ad791aee71aaa.1787887776.git.zhudongjiang@fygo.io>

On Fri Aug 28, 2026 at 12:51 PM JST, Dongjiang Zhu wrote:
> The runtime activation and finish paths apply active-zone accounting to
> both conventional and sequential stripes.
>
> At mount, however, active_zones_left is rebuilt from device zone
> conditions.  Conventional zones report NOT_WP and are therefore not
> included.  Meanwhile, all-conventional block groups are marked active
> and added to zone_active_bgs, so mount recovery still decreases
> reserved_active_zones for their metadata and system stripes.
>
> The two counters can therefore diverge across a remount.
>
> Each unmatched reservation decrement lets data consume one more
> sequential active-zone slot.  Once the reservation becomes negative,
> data can exhaust all such slots.
>
> A later transition from a conventional metadata or system target to a
> sequential one can then fail, because finishing the conventional target
> does not release a sequential active-zone slot.
>
> If this happens during synchronous transaction writeback,
> btrfs_check_meta_write_pointer() returns -EAGAIN.  The transaction is
> then aborted and the filesystem is forced read-only.
>
> The reservation mismatch was reproduced by creating small files with
> large xattrs in batches, syncing them and remounting an HC620 filesystem
> using SINGLE profiles:
>
>   active_zones_left:     126
>   reserved_active_zones: 3 -> -8
>
> The active list contained one partially used conventional system block
> group, nine full conventional metadata block groups and one partially
> used conventional metadata block group.
>
> To keep both counters based on the same physical resource, use
> sequential stripes as the unit of active-zone tracking.  Accordingly, do
> not mark all-conventional block groups active, and update the active-zone
> bitmap and non-data reservation only for sequential stripes during
> activation, finish and mount recovery.
>
> Assisted-by: LLM
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Dongjiang Zhu <zhudongjiang@fygo.io>
> ---
>  fs/btrfs/zoned.c | 59 ++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 42 insertions(+), 17 deletions(-)

I'm sorry to miss this version, but the same comment applies on this
version too.

https://lore.kernel.org/linux-btrfs/DL0AVDP5O9C2.1VT2TYQXCL4B4@wdc.com/

  reply	other threads:[~2026-08-28  5:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  3:51 [PATCH v3 0/4] btrfs: zoned: fix active-zone accounting and transitions Dongjiang Zhu
2026-08-28  3:51 ` [PATCH v3 1/4] btrfs: zoned: track only sequential zones as active Dongjiang Zhu
2026-08-28  5:26   ` Naohiro Aota [this message]
2026-08-28  3:51 ` [PATCH v3 2/4] btrfs: zoned: recover active non-data block group roles on mount Dongjiang Zhu
2026-08-28  5:43   ` Naohiro Aota
2026-08-28 12:07     ` Dongjiang Zhu
2026-08-28  3:51 ` [PATCH v3 3/4] btrfs: zoned: remove obsolete non-data block group activation helper Dongjiang Zhu
2026-08-28  3:51 ` [PATCH v3 4/4] btrfs: zoned: serialize zone finishing per block group Dongjiang Zhu

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=DL0BTAQXFKLH.HG7IL0GTHTK0@wdc.com \
    --to=naohiro.aota@wdc.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.