From patchwork Wed May 28 10:49:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 4254541 X-Patchwork-Delegate: dave@jikos.cz 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 9B8439F336 for ; Wed, 28 May 2014 10:54:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB97020279 for ; Wed, 28 May 2014 10:54:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BEE52026C for ; Wed, 28 May 2014 10:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752851AbaE1Kyu (ORCPT ); Wed, 28 May 2014 06:54:50 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:18332 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751545AbaE1Kyc (ORCPT ); Wed, 28 May 2014 06:54:32 -0400 X-IronPort-AV: E=Sophos;i="4.98,927,1392134400"; d="scan'208";a="31125657" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 May 2014 18:51:55 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s4SAsUix028122 for ; Wed, 28 May 2014 18:54:30 +0800 Received: from localhost.localdomain (10.167.226.111) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.146.2; Wed, 28 May 2014 18:54:34 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH 2/2] btrfs-progs: fix blindly goto failure for chunk-recover Date: Wed, 28 May 2014 18:49:38 +0800 Message-ID: <1401274178-4523-2-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1401274178-4523-1-git-send-email-guihc.fnst@cn.fujitsu.com> References: <1401274178-4523-1-git-send-email-guihc.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.111] 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 If the csum of one stripe is not able to judge the order of two device extents, the stripe may happen to belong to the device extent that is already kicked out as ordered. Take this condition into consideration, don't report failure and give more tries with the stripes following. Signed-off-by: Gui Hecheng --- chunk-recover.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index 924b2f6..5a68d2e 100644 --- a/chunk-recover.c +++ b/chunk-recover.c @@ -1943,10 +1943,9 @@ next_csum: list_splice_init(&unordered, &chunk->dextents); btrfs_release_path(&path); return 0; - } else - ret = 1; + } - goto fail_out; + goto next_stripe; } if (list_is_last(candidates.next, &candidates)) {