From patchwork Wed Nov 26 02:43:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gui Hecheng X-Patchwork-Id: 5383701 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 8A865C11AC for ; Wed, 26 Nov 2014 02:45:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C29FC201C7 for ; Wed, 26 Nov 2014 02:45:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 045EE20160 for ; Wed, 26 Nov 2014 02:45:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbaKZCpZ (ORCPT ); Tue, 25 Nov 2014 21:45:25 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:51513 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751142AbaKZCpZ (ORCPT ); Tue, 25 Nov 2014 21:45:25 -0500 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="43992798" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 Nov 2014 10:42:09 +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 sAQ2j63D012893 for ; Wed, 26 Nov 2014 10:45:06 +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.181.6; Wed, 26 Nov 2014 10:45:28 +0800 From: Gui Hecheng To: CC: Gui Hecheng Subject: [PATCH 1/2] btrfs-progs: remove dead condition for btrfs_map_block Date: Wed, 26 Nov 2014 10:43:40 +0800 Message-ID: <1416969821-2729-1-git-send-email-guihc.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.1.4 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 The @search_cache_extent() only returns the next cache_extent or NULL, it will never return the previous cache_extent. So just remove the dead condition for previous cache_extent handle. Signed-off-by: Gui Hecheng --- volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/volumes.c b/volumes.c index 5b007fc..a1fd162 100644 --- a/volumes.c +++ b/volumes.c @@ -1320,7 +1320,7 @@ again: kfree(multi); return -ENOENT; } - if (ce->start > logical || ce->start + ce->size < logical) { + if (ce->start > logical) { kfree(multi); return -ENOENT; }