From patchwork Wed Dec 15 03:33:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zefan X-Patchwork-Id: 412271 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBF3gUZf002353 for ; Wed, 15 Dec 2010 03:42:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759305Ab0LODm1 (ORCPT ); Tue, 14 Dec 2010 22:42:27 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:61771 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754522Ab0LODm0 (ORCPT ); Tue, 14 Dec 2010 22:42:26 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 6E6C91708D4; Wed, 15 Dec 2010 11:42:23 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oBF3bTJk025533; Wed, 15 Dec 2010 11:37:34 +0800 Received: from lizf.localdomain ([10.167.225.51]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010121511332773-237852 ; Wed, 15 Dec 2010 11:33:27 +0800 Message-ID: <4D08370D.6020705@cn.fujitsu.com> Date: Wed, 15 Dec 2010 11:33:33 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: kreijack@libero.it CC: Chris Mason , linux-btrfs@vger.kernel.org Subject: Re: Bug in the design of the tree search ioctl API ? [was Re: [PATCH 1/3] Btrfs: Really return keys within specified range] References: <4D05EBC9.6020908@cn.fujitsu.com> <201012131913.02276.kreijack@libero.it> <4D07027D.1000500@cn.fujitsu.com> <201012141916.41682.kreijack@libero.it> In-Reply-To: <201012141916.41682.kreijack@libero.it> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-15 11:33:27, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-15 11:42:23, Serialize complete at 2010-12-15 11:42:23 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 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Dec 2010 03:42:31 +0000 (UTC) diff --git a/btrfs-list.c b/btrfs-list.c index 93766a8..1b9ea45 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -620,7 +620,10 @@ int list_subvols(int fd) /* this iteration is done, step forward one root for the next * ioctl */ - if (sk->min_objectid < (u64)-1) { + if (sk->min_type < BTRFS_ROOT_BACKREF_KEY) { + sk->min_type = BTRFS_ROOT_BACKREF_KEY; + sk->min_offset = 0; + } else if (sk->min_objectid < (u64)-1) { sk->min_objectid++; sk->min_type = BTRFS_ROOT_BACKREF_KEY; sk->min_offset = 0;