From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 04/10] btrfs: tree-checker: use table values for stripe checks
Date: Mon, 26 Jul 2021 20:29:25 +0800 [thread overview]
Message-ID: <aa326600-b1e0-e3d4-38b5-1ef0b4527e8e@gmx.com> (raw)
In-Reply-To: <b7a7bb037ee8622784d94f39997d8ab1fbec892a.1627300614.git.dsterba@suse.com>
On 2021/7/26 下午8:15, David Sterba wrote:
> There are hardcoded values in several checks regarding chunks and stripe
> constraints. We have that defined in the raid table and ought to use it.
>
> Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
But one weird off-topics inlined below.
> ---
> fs/btrfs/tree-checker.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
> index a8b2e0d2c025..ac9416cb4496 100644
> --- a/fs/btrfs/tree-checker.c
> +++ b/fs/btrfs/tree-checker.c
> @@ -873,13 +873,18 @@ int btrfs_check_chunk_valid(struct extent_buffer *leaf,
> }
> }
>
> - if (unlikely((type & BTRFS_BLOCK_GROUP_RAID10 && sub_stripes != 2) ||
> - (type & BTRFS_BLOCK_GROUP_RAID1 && num_stripes != 2) ||
> - (type & BTRFS_BLOCK_GROUP_RAID5 && num_stripes < 2) ||
> - (type & BTRFS_BLOCK_GROUP_RAID6 && num_stripes < 3) ||
> - (type & BTRFS_BLOCK_GROUP_DUP && num_stripes != 2) ||
> + if (unlikely((type & BTRFS_BLOCK_GROUP_RAID10 &&
> + sub_stripes != btrfs_raid_array[BTRFS_RAID_RAID10].sub_stripes) ||
> + (type & BTRFS_BLOCK_GROUP_RAID1 &&
> + num_stripes != btrfs_raid_array[BTRFS_RAID_RAID1].devs_min) ||
We're adding support for single device RAID0, but there won't be
anything called single device RAID1 at all, right?
Thanks,
Qu
> + (type & BTRFS_BLOCK_GROUP_RAID5 &&
> + num_stripes < btrfs_raid_array[BTRFS_RAID_RAID5].devs_min) ||
> + (type & BTRFS_BLOCK_GROUP_RAID6 &&
> + num_stripes < btrfs_raid_array[BTRFS_RAID_RAID6].devs_min) ||
> + (type & BTRFS_BLOCK_GROUP_DUP &&
> + num_stripes != btrfs_raid_array[BTRFS_RAID_DUP].dev_stripes) ||
> ((type & BTRFS_BLOCK_GROUP_PROFILE_MASK) == 0 &&
> - num_stripes != 1))) {
> + num_stripes != btrfs_raid_array[BTRFS_RAID_SINGLE].dev_stripes))) {
> chunk_err(leaf, chunk, logical,
> "invalid num_stripes:sub_stripes %u:%u for profile %llu",
> num_stripes, sub_stripes,
>
next prev parent reply other threads:[~2021-07-26 12:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 12:15 [PATCH 00/10] Misc small cleanups David Sterba
2021-07-26 12:15 ` [PATCH 01/10] btrfs: switch uptodate to bool in btrfs_writepage_endio_finish_ordered David Sterba
2021-07-26 12:23 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 02/10] btrfs: remove uptodate parameter from btrfs_dec_test_first_ordered_pending David Sterba
2021-07-26 12:24 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 03/10] btrfs: make btrfs_next_leaf static inline David Sterba
2021-07-26 12:25 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 04/10] btrfs: tree-checker: use table values for stripe checks David Sterba
2021-07-26 12:29 ` Qu Wenruo [this message]
2021-07-26 14:47 ` David Sterba
2021-07-26 12:15 ` [PATCH 05/10] btrfs: tree-checker: add missing stripe checks for raid1c3/4 profiles David Sterba
2021-07-26 12:29 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 06/10] btrfs: uninline btrfs_bg_flags_to_raid_index David Sterba
2021-07-26 12:34 ` Qu Wenruo
2021-07-26 15:06 ` David Sterba
2021-07-26 12:15 ` [PATCH 07/10] btrfs: merge alloc_device helpers David Sterba
2021-07-26 12:35 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 08/10] btrfs: simplify data stripe calculation helpers David Sterba
2021-07-26 12:38 ` Qu Wenruo
2021-07-26 15:06 ` David Sterba
2021-07-26 22:23 ` Qu Wenruo
2021-07-27 8:39 ` David Sterba
2021-07-27 9:32 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 09/10] btrfs: constify and cleanup variables comparators David Sterba
2021-07-26 12:15 ` [PATCH 10/10] btrfs: add and use simple page/bio to inode/fs_info helpers David Sterba
2021-07-26 12:41 ` Qu Wenruo
2021-07-26 15:09 ` David Sterba
2021-07-26 22:26 ` Qu Wenruo
2021-07-27 8:45 ` David Sterba
2021-07-27 9:42 ` Qu Wenruo
2021-07-27 14:44 ` David Sterba
2021-07-27 15:03 ` [PATCH v2 " David Sterba
2021-07-28 0:12 ` Qu Wenruo
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=aa326600-b1e0-e3d4-38b5-1ef0b4527e8e@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).