diff mbox

btrfs: Do not return more items that user asked from from search ioctl

Message ID 1282340432-15564-1-git-send-email-jack@suse.cz
State New, archived
Headers show

Commit Message

Jan Kara Aug. 20, 2010, 9:40 p.m. UTC
None
diff mbox

Patch

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: