From patchwork Fri Aug 20 21:40:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 121081 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7KLlD1T014960 for ; Fri, 20 Aug 2010 21:47:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543Ab0HTVrK (ORCPT ); Fri, 20 Aug 2010 17:47:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60281 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267Ab0HTVrJ (ORCPT ); Fri, 20 Aug 2010 17:47:09 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id A38FC87567; Fri, 20 Aug 2010 23:47:08 +0200 (CEST) Received: by quack.suse.cz (Postfix, from userid 10005) id DA5E52B1C64; Fri, 20 Aug 2010 23:40:35 +0200 (CEST) From: Jan Kara To: chris.mason@oracle.com Cc: linux-btrfs@vger.kernel.org, Jan Kara Subject: [PATCH] btrfs: Do not return more items that user asked from from search ioctl Date: Fri, 20 Aug 2010 23:40:32 +0200 Message-Id: <1282340432-15564-1-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.6.4.2 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]); Fri, 20 Aug 2010 21:47:13 +0000 (UTC) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9254b3d..94e7ab5 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -977,7 +977,7 @@ static noinline int copy_to_sk(struct btrfs_root *root, } found++; - if (*num_found >= sk->nr_items) + if (*num_found + found >= sk->nr_items) break; } advance_key: