Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Cc: Qu Wenruo <wqu@suse.com>
Subject: Re: [PATCH 01/15] btrfs: fix minimum number of chunk errors for DUP
Date: Fri, 17 May 2019 22:05:04 +0800
Message-ID: <cfbc6c78-6475-5da7-6186-07591f4a19a1@gmx.com> (raw)
In-Reply-To: <f238d8b46f4645dd8d402007774a8748499e59f8.1558085801.git.dsterba@suse.com>

[-- Attachment #1.1: Type: text/plain, Size: 1815 bytes --]



On 2019/5/17 下午5:43, David Sterba wrote:
> The list of profiles in btrfs_chunk_max_errors lists DUP as a profile
> DUP able to tolerate 1 device missing. Though this profile is special
> with 2 copies, it still needs the device, unlike the others.
> 
> Looking at the history of changes, thre's no clear reason why DUP is
> there, functions were refactored and blocks of code merged to one
> helper.
> 
> d20983b40e828 Btrfs: fix writing data into the seed filesystem
>   - factor code to a helper
> 
> de11cc12df173 Btrfs: don't pre-allocate btrfs bio
>   - unrelated change, DUP still in the list with max errors 1
> 
> a236aed14ccb0 Btrfs: Deal with failed writes in mirrored configurations
>   - introduced the max errors, leaves DUP and RAID1 in the same group
> 
> CC: Qu Wenruo <wqu@suse.com>
> Signed-off-by: David Sterba <dsterba@suse.com

Reviewed-by: Qu Wenruo <wqu@suse.com>

Just some extra hint for the tolerance of DUP profile.

In case of DUP, either all stripes are missing, or all stripes exist.

So no matter whether the tolerance is 0 or 1, it will always work.
But indeed, setting it to 0 is more accurate.

Thanks,
Qu
> ---
>  fs/btrfs/volumes.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 1c2a6e4b39da..8508f6028c8d 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -5328,8 +5328,7 @@ static inline int btrfs_chunk_max_errors(struct map_lookup *map)
>  
>  	if (map->type & (BTRFS_BLOCK_GROUP_RAID1 |
>  			 BTRFS_BLOCK_GROUP_RAID10 |
> -			 BTRFS_BLOCK_GROUP_RAID5 |
> -			 BTRFS_BLOCK_GROUP_DUP)) {
> +			 BTRFS_BLOCK_GROUP_RAID5)) {
>  		max_errors = 1;
>  	} else if (map->type & BTRFS_BLOCK_GROUP_RAID6) {
>  		max_errors = 2;
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17  9:43 [PATCH 00/15] RAID/volumes code cleanups David Sterba
2019-05-17  9:43 ` [PATCH 01/15] btrfs: fix minimum number of chunk errors for DUP David Sterba
2019-05-17 14:05   ` Qu Wenruo [this message]
2019-05-17  9:43 ` [PATCH 02/15] btrfs: raid56: allow the exact minimum number of devices for balance convert David Sterba
2019-05-17  9:43 ` [PATCH 03/15] btrfs: remove mapping tree structures indirection David Sterba
2019-05-17  9:43 ` [PATCH 04/15] btrfs: use raid_attr table in get_profile_num_devs David Sterba
2019-05-17  9:43 ` [PATCH 05/15] btrfs: use raid_attr in btrfs_chunk_max_errors David Sterba
2019-05-17  9:43 ` [PATCH 06/15] btrfs: use raid_attr table in calc_stripe_length for nparity David Sterba
2019-05-17 10:06   ` Hans van Kranenburg
2019-05-17 12:54     ` David Sterba
2019-05-17 13:06       ` Hans van Kranenburg
2019-05-17  9:43 ` [PATCH 07/15] btrfs: use raid_attr to get allowed profiles for balance conversion David Sterba
2019-05-17  9:43 ` [PATCH 08/15] btrfs: use raid_attr table to find profiles for integrity lowering David Sterba
2019-05-17  9:43 ` [PATCH 09/15] btrfs: use raid_attr table for btrfs_bg_type_to_factor David Sterba
2019-05-17  9:43 ` [PATCH 10/15] btrfs: factor out helper for counting data stripes David Sterba
2019-05-17  9:43 ` [PATCH 11/15] btrfs: use u8 for raid_array members David Sterba
2019-05-17  9:43 ` [PATCH 12/15] btrfs: factor out devs_max setting in __btrfs_alloc_chunk David Sterba
2019-05-17  9:43 ` [PATCH 13/15] btrfs: refactor helper for bg flags to name conversion David Sterba
2019-05-17  9:43 ` [PATCH 14/15] btrfs: constify map parameter for nr_parity_stripes and nr_data_stripes David Sterba
2019-05-17  9:43 ` [PATCH 15/15] btrfs: read number of data stripes from map only once David Sterba

Reply instructions:

You may reply publically 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=cfbc6c78-6475-5da7-6186-07591f4a19a1@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox