From patchwork Thu Mar 25 12:32:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 88212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2PCVwXv030038 for ; Thu, 25 Mar 2010 12:31:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997Ab0CYMb6 (ORCPT ); Thu, 25 Mar 2010 08:31:58 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:56235 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751981Ab0CYMb5 (ORCPT ); Thu, 25 Mar 2010 08:31:57 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 57E44170118; Thu, 25 Mar 2010 20:31:56 +0800 (CST) Received: from 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 o2PCUac0005978; Thu, 25 Mar 2010 20:30:36 +0800 Received: from [127.0.0.1] (unknown [10.167.141.211]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 03E4FDC220; Thu, 25 Mar 2010 20:34:22 +0800 (CST) Message-ID: <4BAB57CC.9080809@cn.fujitsu.com> Date: Thu, 25 Mar 2010 20:32:12 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Chris Mason CC: Linux Btrfs Subject: [PATCH 07/18] btrfs: Fix a BUG_ON boundary typo Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Mar 2010 12:31:59 +0000 (UTC) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 9df8e3f..844c393 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2598,7 +2598,7 @@ int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len) read_unlock(&em_tree->lock); BUG_ON(!em); - BUG_ON(em->start > logical || em->start + em->len < logical); + BUG_ON(em->start > logical || em->start + em->len <= logical); map = (struct map_lookup *)em->bdev; if (map->type & (BTRFS_BLOCK_GROUP_DUP | BTRFS_BLOCK_GROUP_RAID1)) ret = map->num_stripes; @@ -2673,7 +2673,7 @@ again: BUG(); } - BUG_ON(em->start > logical || em->start + em->len < logical); + BUG_ON(em->start > logical || em->start + em->len <= logical); map = (struct map_lookup *)em->bdev; offset = logical - em->start;