Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2766556ybh; Mon, 5 Aug 2019 06:31:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzruJ+KevfcQtguUmMxvJ3hsy5KKDifMB5DA52bkpm3refyyiHDdluCH93yW7OKZ1uZXOzT X-Received: by 2002:a17:902:b905:: with SMTP id bf5mr134647589plb.342.1565011882748; Mon, 05 Aug 2019 06:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011882; cv=none; d=google.com; s=arc-20160816; b=G6fArc5PmtbwovJ5Vpknro/dK4fZJDuI4KisfPQsr5rhl9XWdRD4voA4+C3GuC2jvY w92nKuXb5aPiDOWwTOY4XFYJymh+9pQSQKQPZpdTV5r4SmM7KSMuaMoJCGdEFUvF/XMs 5lmMeLfCSlr7vTjlaUYbop9nM4ldWX7iCPikEocqY+k5KFyy+/RRzPhvxO8lOTEejxwr iyExq/K8RWIbZ0adIszc0TBxt90hh/q2whY+KwnGOFDdCCtXgQ2q8GLCwzV7p5BgrnFs +uUA5ebYEIGMa2RkRHj8PVWUk2+UPcL2hu/CXlK9uRbcQ6pfrGmLaG/ajPO5HZXZcPNn a/MQ== 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=juuYQrKyFXPB6Z7JJoRjrnhv1v8MvRYnU/yGDZNp1SM=; b=yP+seNFEEseprqfQZRGTDHLa6SUcCqNYOMHHjbOdIioS0+DUmuWFR2zHo3jLSYpeRv D0Dd6BuVBn6ROI/3vNq9X7pv/pICNFSAa/EUUwCQ1ZTJTCenAy8qW0HPNNNQS1CTTUoX 1BI0iIZTwzbaIjUl6VSe/IlcxYJs/niOVeD4jNUKW8ec4WsjVqs+SPMTS2VuL4PzJGkN NKhpQeZJDDSP3RX8Swpr8f++ryHQGlBipZpgdzL3u5M0StY6I4gENS9d7miD9hZgptzt H0UwczOTiCpqWZLPVRLYFULCsHDJTOhVaGYnHXYiefYLVuB3qv8AWdRuS6vnAWDLFRyY tcxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cCwYEf39; 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 y13si45971769pfp.133.2019.08.05.06.31.07; Mon, 05 Aug 2019 06:31:22 -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=cCwYEf39; 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 S1730128AbfHENVV (ORCPT + 99 others); Mon, 5 Aug 2019 09:21:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730449AbfHENVH (ORCPT ); Mon, 5 Aug 2019 09:21:07 -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 437B320657; Mon, 5 Aug 2019 13:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011266; bh=2anYfaSMEW9hwR3HSdQR1JHRUgCCY3/Xz79c8TsQN2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cCwYEf39Wu084CzJH0msksYQCSFyo6VfCdf1pfPjFT/hvbeyDsbhSf0s6Pd2rHNly 9ywyKvtrRe9T/ZQSpONLbE2qk1MEcKsPux8Ts15SWs94NDC0+JUPe2yXICNxiZgMbZ iTnlR521KU8DOEyQSzlF83rwlJ8KA1GOJbX9c/xg= 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 5.2 027/131] btrfs: fix minimum number of chunk errors for DUP Date: Mon, 5 Aug 2019 15:01:54 +0200 Message-Id: <20190805124953.257152699@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@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 1c2a6e4b39da7..8508f6028c8d2 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; -- 2.20.1