public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Naohiro Aota <naohiro.aota@wdc.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 00/12] btrfs-progs: zoned: support zone capacity and
Date: Wed, 5 Mar 2025 14:20:43 +0100	[thread overview]
Message-ID: <20250305132043.GF5777@twin.jikos.cz> (raw)
In-Reply-To: <cover.1739951758.git.naohiro.aota@wdc.com>

On Wed, Feb 19, 2025 at 04:57:44PM +0900, Naohiro Aota wrote:
> Running mkfs.btrfs on a null_blk device with the following setup fails
> as below.
> 
> - zone size: 64MB
> - zone capacity: 64MB
> - number of conventional zones: 6
> - storage size: 2048MB
> 
>     + /home/naota/src/btrfs-progs/mkfs.btrfs -d single -m dup -f /dev/nullb0
>     btrfs-progs v6.10
>     See https://btrfs.readthedocs.io for more information.
> 
>     zoned: /dev/nullb0: host-managed device detected, setting zoned feature
>     Resetting device zones /dev/nullb0 (32 zones) ...
>     NOTE: several default settings have changed in version 5.15, please make sure
>           this does not affect your deployments:
>           - DUP for metadata (-m dup)
>           - enabled no-holes (-O no-holes)
>           - enabled free-space-tree (-R free-space-tree)
> 
>     bad tree block 268435456, bytenr mismatch, want=268435456, have=0
>     kernel-shared/disk-io.c:485: write_tree_block: BUG_ON `1` triggered, value 1
>     /home/naota/src/btrfs-progs/mkfs.btrfs(+0x290ca) [0x55603cf7e0ca]
>     /home/naota/src/btrfs-progs/mkfs.btrfs(write_tree_block+0xa7) [0x55603cf80417]
>     /home/naota/src/btrfs-progs/mkfs.btrfs(__commit_transaction+0xe8) [0x55603cf9b7d8]
>     /home/naota/src/btrfs-progs/mkfs.btrfs(btrfs_commit_transaction+0x176) [0x55603cf9ba66]
>     /home/naota/src/btrfs-progs/mkfs.btrfs(main+0x2831) [0x55603cf67291]
>     /usr/lib64/libc.so.6(+0x271ee) [0x7f5ab706f1ee]
>     /usr/lib64/libc.so.6(__libc_start_main+0x89) [0x7f5ab706f2a9]
>     /home/naota/src/btrfs-progs/mkfs.btrfs(_start+0x25) [0x55603cf6a135]
>     /home/naota/tmp/test-mkfs.sh: line 13: 821886 Aborted                 (core dumped)
> 
> The crash happens because btrfs-progs failed to set proper allocation
> pointer when a DUP block group is created over a conventional zone and a
> sequential write required zone. In that case, the write pointer is
> recovered from the last allocated extent in the block group. That
> functionality is not well implemented in btrfs-progs side.
> 
> Implementing that functionality is relatively trivial because we can
> copy the code from the kernel side. However, the code is quite out of
> sync between the kernel side and user space side. So, this series first
> refactors btrfs_load_block_group_zone_info() to make it easy to
> integrate the code from the kernel side.
> 
> The main part is the last patch, which fixes allocation pointer
> calculation for all the profiles.
> 
> While at it, this series also adds support for zone capacity and zone
> activeness. But, zone activeness support is currently limited. It does
> not attempt to check the zone active limit on the extent allocation,
> because mkfs.btrfs should work without hitting the limit.
> 
> - v2
>     - Temporarily fails some profiles while adding supports in the patch
>       series.
> - v1: https://lore.kernel.org/linux-btrfs/cover.1739756953.git.naohiro.aota@wdc.com/
> 
> Naohiro Aota (12):
>   btrfs-progs: introduce min_not_zero()
>   btrfs-progs: zoned: introduce a zone_info struct in
>     btrfs_load_block_group_zone_info
>   btrfs-progs: zoned: support zone capacity
>   btrfs-progs: zoned: load zone activeness
>   btrfs-progs: zoned: activate block group on loading
>   btrfs-progs: factor out btrfs_load_zone_info()
>   btrfs-progs: zoned: factor out SINGLE zone info loading
>   btrfs-progs: zoned: implement DUP zone info loading
>   btrfs-progs: zoned: implement RAID1 zone info loading
>   btrfs-progs: zoned: implement RAID0 zone info loading
>   btrfs-progs: implement RAID10 zone info loading
>   btrfs-progs: zoned: fix alloc_offset calculation for partly
>     conventional block groups

Added to devel, thanks.

      parent reply	other threads:[~2025-03-05 13:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19  7:57 [PATCH v2 00/12] btrfs-progs: zoned: support zone capacity and Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 01/12] btrfs-progs: introduce min_not_zero() Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 02/12] btrfs-progs: zoned: introduce a zone_info struct in btrfs_load_block_group_zone_info Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 03/12] btrfs-progs: zoned: support zone capacity Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 04/12] btrfs-progs: zoned: load zone activeness Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 05/12] btrfs-progs: zoned: activate block group on loading Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 06/12] btrfs-progs: factor out btrfs_load_zone_info() Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 07/12] btrfs-progs: zoned: factor out SINGLE zone info loading Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 08/12] btrfs-progs: zoned: implement DUP " Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 09/12] btrfs-progs: zoned: implement RAID1 " Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 10/12] btrfs-progs: zoned: implement RAID0 " Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 11/12] btrfs-progs: implement RAID10 " Naohiro Aota
2025-02-19  7:57 ` [PATCH v2 12/12] btrfs-progs: zoned: fix alloc_offset calculation for partly conventional block groups Naohiro Aota
2025-02-19 16:58   ` Johannes Thumshirn
2025-02-20  5:06     ` Naohiro Aota
2025-02-19 16:58 ` [PATCH v2 00/12] btrfs-progs: zoned: support zone capacity and Johannes Thumshirn
2025-03-05 13:20 ` David Sterba [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=20250305132043.GF5777@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.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