Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2753675ybh; Mon, 5 Aug 2019 06:19:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmDZ/P0aA8nKoqNhDuul29a6InLpLN76y/f0EC51U5UesmBHBrbwygqxKBLu8gThUynEsD X-Received: by 2002:a63:f357:: with SMTP id t23mr28967427pgj.421.1565011142331; Mon, 05 Aug 2019 06:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011142; cv=none; d=google.com; s=arc-20160816; b=ddZ54EHqSzNdUOBCpsAo26gVU6h1nyFS9ViKy9GJsX5PUSIP4DGnRF3ovlRXG1Gc80 sRLrP52hsx9pr0TfO4HG8C8FNPoNAa/g2qXxdC6jCxrsZMYBM0S64i+EyILwVWCEdc9S a3cWKNVwMrzgEJs9cxPd5DDpCc3DJRuZc0vd9rt8uqJaUFrq8rAzBh0lbuok20LoyzXe GyrggwyHAbRNRbjrBYXoz2egmuxfnadvYcYU6qADFP+ttvVcqk3DvWgooXLCnGtWa8lg rt+uIllhQKcOSyCbsfVuAvA93KRSDuXBOVi0UUUiliog5TDSOnVv4yDjhvORA5swOTyR QKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JJ72P/+T5JzFD9QulKfl4BBHTdsD0QaFX0hzD8lEIgU=; b=OH3XXjHhuI6DSqcxcwB5z8N7J2lndJtWmfEDc21zW8HhyEmPnNRkNl+QvFqdC8ThxG yaKn/+uh5ht00TcPYeQDOUIsOs8tLVMh7CA3TZJFgjoNSqueggY6StqWz+avu1PndF6o 8JjnlFSMxgFoyB1TbDtC/241no7k+TlGBqsAnFhsG8qIL3Mv6y5pvBvCxSGAkLAzJCO1 Z5fg6tVqXwPz50p5C4EgVOleKPHEJxfF/lHUS146XWljReEbhREDS/4x3a3CqzpoNKqI hEUP71nq/ngfDT9CDQrcaeN1U7/RLK+0/uii5K0d7mltb1UpZIGZ4mf+nkvdY3o4ZNhQ 9H5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MghlLT8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si39671956plo.33.2019.08.05.06.18.47; Mon, 05 Aug 2019 06:19:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MghlLT8c; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729183AbfHENE5 (ORCPT + 99 others); Mon, 5 Aug 2019 09:04:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:40704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729156AbfHENEw (ORCPT ); Mon, 5 Aug 2019 09:04:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7377F214C6; Mon, 5 Aug 2019 13:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565010292; bh=JKwcJRZkRAKgMmzGE5HGZFN8tWHhFzAl1WyKrGJDWGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MghlLT8cIfJtQknBzZgm+drv/0lLSgdBtoH4eh2K39mYQUXAEFnRfTSRwu+PMofvk Uf1i6ctvv70gTdU/aOkDJgZA5U5ZnBJBcShdBMcNHeDET09TYFUx0zTRXD9ww9JdUD VTm6XmAXcnwiJs2KuEaQ+CMPGg+sJ5IgCyXVTBUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qu Wenruo , David Sterba , Sasha Levin Subject: [PATCH 4.9 10/42] btrfs: fix minimum number of chunk errors for DUP Date: Mon, 5 Aug 2019 15:02:36 +0200 Message-Id: <20190805124926.055875161@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124924.788666484@linuxfoundation.org> References: <20190805124924.788666484@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 0ee5f8ae082e1f675a2fb6db601c31ac9958a134 ] 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 Reviewed-by: Qu Wenruo Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- 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 94b61afe996c8..70aa22a8a9cce 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5072,8 +5072,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; -- 2.20.1