From patchwork Thu Aug 8 05:04:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 2840744 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 EA3B29F962 for ; Thu, 8 Aug 2013 05:06:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3406D20347 for ; Thu, 8 Aug 2013 05:06:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EFDF2034D for ; Thu, 8 Aug 2013 05:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757671Ab3HHFFw (ORCPT ); Thu, 8 Aug 2013 01:05:52 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:43999 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1757656Ab3HHFFu (ORCPT ); Thu, 8 Aug 2013 01:05:50 -0400 X-IronPort-AV: E=Sophos;i="4.89,836,1367942400"; d="scan'208";a="8151111" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 08 Aug 2013 13:02:45 +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 r7855lVU008784 for ; Thu, 8 Aug 2013 13:05:47 +0800 Received: from localhost.localdomain ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013080813042326-517235 ; Thu, 8 Aug 2013 13:04:23 +0800 From: Wang Shilong To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/3] Btrfs: catch error return value from find_extent_in_eb() Date: Thu, 8 Aug 2013 13:04:18 +0800 Message-Id: <1375938259-5015-2-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.0.1 In-Reply-To: <1375938259-5015-1-git-send-email-wangsl.fnst@cn.fujitsu.com> References: <1375938259-5015-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 2013/08/08 13:04:23, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/08/08 13:04:23, Serialize complete at 2013/08/08 13:04:23 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 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 find_extent_in_eb() may return ENOMEM, catch this error return value. Signed-off-by: Wang Shilong Reviewed-by: Miao Xie --- fs/btrfs/backref.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 54e7610..f7781e6 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -934,6 +934,10 @@ again: } ret = find_extent_in_eb(eb, bytenr, *extent_item_pos, &eie); + if (ret) { + free_extent_buffer(eb); + goto out; + } ref->inode_list = eie; free_extent_buffer(eb); }