From: Boris Burkov <boris@bur.io>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
Naohiro Aota <naohiro.aota@wdc.com>, HAN Yuwei <hrx@bupt.moe>
Subject: Re: [PATCH] btrfs: zoned: don't skip block group profile checks on conv zones
Date: Tue, 13 Feb 2024 13:58:48 -0800 [thread overview]
Message-ID: <20240213215848.GA306016@zen.localdomain> (raw)
In-Reply-To: <0cd08a6b0f5285498811504d3713ced3afe3b8d2.1707812175.git.johannes.thumshirn@wdc.com>
On Tue, Feb 13, 2024 at 12:16:15AM -0800, Johannes Thumshirn wrote:
> On a zoned filesystem with conventional zones, we're skipping the block
> group profile checks for the conventional zones.
>
> This allows converting a zoned filesystem's data block groups to RAID when
> all of the zones backing the chunk are on conventional zones. But this
> will lead to problems, once we're trying to allocate chunks backed by
> sequential zones.
>
> So also check for conventional zones when loading a block group's profile
> on them.
>
> Reported-by: HAN Yuwei <hrx@bupt.moe>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
> ---
> fs/btrfs/zoned.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index d9716456bce0..e43c689b1253 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -1637,6 +1637,15 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
> }
>
> out:
> + /* Reject non SINGLE data profiles without RST */
> + if ((map->type & BTRFS_BLOCK_GROUP_DATA) &&
> + (map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) &&
> + !fs_info->stripe_root) {
> + btrfs_err(fs_info, "zoned: data %s needs raid-stripe-tree",
> + btrfs_bg_type_to_raid_name(map->type));
> + return -EINVAL;
> + }
> +
> if (cache->alloc_offset > cache->zone_capacity) {
> btrfs_err(fs_info,
> "zoned: invalid write pointer %llu (larger than zone capacity %llu) in block group %llu",
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-02-13 21:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 8:16 [PATCH] btrfs: zoned: don't skip block group profile checks on conv zones Johannes Thumshirn
2024-02-13 21:58 ` Boris Burkov [this message]
2024-02-14 15:59 ` Naohiro Aota
2024-02-14 18:11 ` David Sterba
-- strict thread matches above, loose matches on Subject: below --
2024-02-09 10:46 Johannes Thumshirn
2024-02-09 14:29 ` Naohiro Aota
2024-02-12 9:48 ` Johannes Thumshirn
2024-02-12 1:59 ` Damien Le Moal
2024-02-12 4:00 ` HAN Yuwei
2024-02-12 11: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=20240213215848.GA306016@zen.localdomain \
--to=boris@bur.io \
--cc=dsterba@suse.cz \
--cc=hrx@bupt.moe \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
--cc=quwenruo.btrfs@gmx.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