From patchwork Mon Sep 22 01:13:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 4945191 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 CD9CCBEEA5 for ; Mon, 22 Sep 2014 01:13:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D88E82021A for ; Mon, 22 Sep 2014 01:13:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2AD2201D3 for ; Mon, 22 Sep 2014 01:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbaIVBNO (ORCPT ); Sun, 21 Sep 2014 21:13:14 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:65369 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751617AbaIVBNO (ORCPT ); Sun, 21 Sep 2014 21:13:14 -0400 X-IronPort-AV: E=Sophos;i="5.04,568,1406563200"; d="scan'208";a="36250076" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Sep 2014 09:10:11 +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 s8M1DG9A021227; Mon, 22 Sep 2014 09:13:17 +0800 Received: from adam-work.lan (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 22 Sep 2014 09:13:13 +0800 From: Qu Wenruo To: CC: Subject: [PATCH] btrfs: Fix the wrong condition judgment about subset extent map Date: Mon, 22 Sep 2014 09:13:03 +0800 Message-ID: <1411348383-13587-1-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] 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.7 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 Previous commit: btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map is using wrong condition to judgement whether the range is a subset of a existing extent map. This may cause bug in btrfs no-holes mode. This patch will correct the judgment and fix the bug. Signed-off-by: Qu Wenruo --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8039021..a99ee9d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6527,7 +6527,7 @@ insert: * extent causing the -EEXIST. */ if (start >= extent_map_end(existing) || - start + len <= existing->start) { + start <= existing->start) { /* * The existing extent map is the one nearest to * the [start, start + len) range which overlaps