From patchwork Thu Jan 23 05:47:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3526631 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78129C02DC for ; Thu, 23 Jan 2014 06:00:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A207C2017A for ; Thu, 23 Jan 2014 06:00:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC81720173 for ; Thu, 23 Jan 2014 06:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755764AbaAWGAG (ORCPT ); Thu, 23 Jan 2014 01:00:06 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:18955 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750915AbaAWGAC (ORCPT ); Thu, 23 Jan 2014 01:00:02 -0500 X-IronPort-AV: E=Sophos;i="4.95,704,1384272000"; d="scan'208";a="9446599" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 23 Jan 2014 13:56:20 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0N5nMxb002339 for ; Thu, 23 Jan 2014 13:49:33 +0800 Received: from wangs.fnst.cn.fujitsu.com ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014012313473780-1304243 ; Thu, 23 Jan 2014 13:47:37 +0800 From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/2] Btrfs: fix to catch all errors when resolving indirect ref Date: Thu, 23 Jan 2014 13:47:49 +0800 Message-Id: <1390456069-5577-2-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1390456069-5577-1-git-send-email-wangsl.fnst@cn.fujitsu.com> References: <1390456069-5577-1-git-send-email-wangsl.fnst@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/23 13:47:38, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/23 13:48:08, Serialize complete at 2014/01/23 13:48:08 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=unavailable 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 We can only tolerate ENOENT here, for other errors, we should return directly. Signed-off-by: Wang Shilong --- fs/btrfs/backref.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index fd9ae72..3512437 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -387,10 +387,16 @@ static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info, continue; err = __resolve_indirect_ref(fs_info, path, time_seq, ref, parents, extent_item_pos); - if (err == -ENOMEM) - goto out; - if (err) + /* + * we can only tolerate ENOENT,otherwise,we should catch error + * and return directly. + */ + if (err == -ENOENT) { continue; + } else if (err) { + ret = err; + goto out; + } /* we put the first parent into the ref at hand */ ULIST_ITER_INIT(&uiter);