From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B209C7618B for ; Fri, 26 Jul 2019 13:51:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7558822CE9 for ; Fri, 26 Jul 2019 13:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564149102; bh=gbcc84ARd22giqHzhSk4zUe9cJYXraCr4L0P/X85fLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=biyeONyh3T4l8bwOyUQ5kvd4b36sHwzYjwpts0xxTVqT/Z08DngfUixvA4fHFnJsF lGreRfCDnF0fy2GlXrqEAblbdZVutUcVAN2Qef+Dt36DmEYR7QmPmtzEMOzfQSiolN QwOMREmUUmnoCAdUAQPYpU2rc9g19Y/0t5F2pJao= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727267AbfGZNnu (ORCPT ); Fri, 26 Jul 2019 09:43:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:51730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388267AbfGZNnt (ORCPT ); Fri, 26 Jul 2019 09:43:49 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9159E22BF5; Fri, 26 Jul 2019 13:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564148628; bh=gbcc84ARd22giqHzhSk4zUe9cJYXraCr4L0P/X85fLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tVfoVl5nJe/QQjbxgkg5ACrvQOVHxJbmsywUiEB5fV2M8pCVZCKL8aTZ1g+m0DwC5 9wC8taG7WyonGPyVrWFYvlVTIU+NCp8nwreF5VxRsYQm7cqsBSFGDx52TUAjzRwlqu bNdJ+CZLq3q3kaQ3AsIkiQJMV+LSA5J/JkcE8hUE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Sterba , Qu Wenruo , Sasha Levin , linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 11/37] btrfs: fix minimum number of chunk errors for DUP Date: Fri, 26 Jul 2019 09:43:06 -0400 Message-Id: <20190726134332.12626-11-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190726134332.12626-1-sashal@kernel.org> References: <20190726134332.12626-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: David Sterba [ 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 85294fef1051..358e930df4ac 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -5019,8 +5019,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