From patchwork Wed Jul 10 11:54:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 2825630 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B8289F9CF for ; Wed, 10 Jul 2013 11:54:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E613E20181 for ; Wed, 10 Jul 2013 11:54:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DEA822015F for ; Wed, 10 Jul 2013 11:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753897Ab3GJLyh (ORCPT ); Wed, 10 Jul 2013 07:54:37 -0400 Received: from mail-bk0-f42.google.com ([209.85.214.42]:42289 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173Ab3GJLyh (ORCPT ); Wed, 10 Jul 2013 07:54:37 -0400 Received: by mail-bk0-f42.google.com with SMTP id jk13so2817629bkc.1 for ; Wed, 10 Jul 2013 04:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=KHbi41ALl4jxmIVTGwpCBHw92xgkbsdPJ+Do4Fgy7qI=; b=W9uxGIlcz2csZ8Jg0MsuskPe8go0nABmH4JkAb7SKLd5a+NE6keL1Y/deiwveVAyLP CMYB3lltiTrJDDW4PQbbHRhRR3X7eqv0h6a7ankVucVQsh2Si0owVP+Yt1g3SIfQlQ4e qMAY+qGik08/sZ0sRFH8Bg7WcspjfVgyrqpCum7LAQUYylIXsWhOc9sZ/kDD6EXxnKrQ RG669fqx4DFaJf5G4pvg4vzO3FLoukR/lzEa1nUfifx4xlXFAPi5DvPZkJp3O64HVGL8 38p/wfuDYPQkZEx5APTANua1vMaKwR8WOgWz7A6xM1cBK6pfaZE5QhvAPlZsLRkHUHw6 eQJA== X-Received: by 10.204.229.208 with SMTP id jj16mr4609441bkb.65.1373457275421; Wed, 10 Jul 2013 04:54:35 -0700 (PDT) Received: from localhost ([31.28.225.198]) by mx.google.com with ESMTPSA id lb14sm6942579bkb.6.2013.07.10.04.54.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 10 Jul 2013 04:54:34 -0700 (PDT) From: Ilya Dryomov To: linux-btrfs@vger.kernel.org Cc: Chris Mason , idryomov@gmail.com, Stefan Behrens Subject: [PATCH] Btrfs: num_tolerated_disk_barrier_failures is incorrect for RAID6 Date: Wed, 10 Jul 2013 14:54:30 +0300 Message-Id: <1373457270-18909-1-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently num_tolerated_disk_barrier_failures gets the value of fs_devices->num_devices in the RAID6 case. But, RAID6 can tolerate only two simultaneous failures, so set it to 2. CC: Stefan Behrens Signed-off-by: Ilya Dryomov --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b8b60b6..aecf788 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3258,7 +3258,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures( BTRFS_BLOCK_GROUP_RAID10)) { num_tolerated_disk_barrier_failures = 1; } else if (flags & - BTRFS_BLOCK_GROUP_RAID5) { + BTRFS_BLOCK_GROUP_RAID6) { num_tolerated_disk_barrier_failures = 2; } }