[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230914181052.GC20408@twin.jikos.cz>
Date: Thu, 14 Sep 2023 20:10:52 +0200
From: David Sterba <dsterba@...e.cz>
To: Johannes Thumshirn <johannes.thumshirn@....com>
Cc: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
Christoph Hellwig <hch@....de>,
Naohiro Aota <naohiro.aota@....com>, Qu Wenruo <wqu@...e.com>,
Damien Le Moal <dlemoal@...nel.org>,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 03/11] btrfs: add support for inserting raid stripe
extents
On Thu, Sep 14, 2023 at 09:06:58AM -0700, Johannes Thumshirn wrote:
> + map_type = list_first_entry(&ordered_extent->bioc_list, typeof(*bioc),
> + ordered_entry)->map_type;
> +
> + switch (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK) {
> + case BTRFS_BLOCK_GROUP_DUP:
> + case BTRFS_BLOCK_GROUP_RAID1:
> + case BTRFS_BLOCK_GROUP_RAID1C3:
> + case BTRFS_BLOCK_GROUP_RAID1C4:
> + ret = btrfs_insert_mirrored_raid_extents(trans, ordered_extent,
> + map_type);
> + break;
> + case BTRFS_BLOCK_GROUP_RAID0:
> + ret = btrfs_insert_striped_raid_extents(trans, ordered_extent,
> + map_type);
> + break;
> + case BTRFS_BLOCK_GROUP_RAID10:
> + ret = btrfs_insert_striped_mirrored_raid_extents(trans, ordered_extent, map_type);
> + break;
> + default:
> + btrfs_err(trans->fs_info, "unknown block-group profile %lld",
> + map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK);
> + ASSERT(0);
Please don't use ASSERT(0), the error is handled and no need to crash
here.
> + ret = -EINVAL;
> + break;
> + }
Powered by blists - more mailing lists