Btrfs: return keys for large items to the search ioctl
authorChris Mason <chris.mason@oracle.com>
Thu, 18 Mar 2010 16:14:54 +0000 (12:14 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 18 Mar 2010 16:14:54 +0000 (12:14 -0400)
The search ioctl was skipping large items entirely (ones that are too
big for the results buffer).  This changes things to at least copy
the item header so that we can send information about the item back to
userland.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c

index 291aa51ff4200fed75c3281623d774bd8261fefe..fd757f5769562cb33ca68c695a361e09cb916c2b 100644 (file)
@@ -997,8 +997,8 @@ static noinline int copy_to_sk(struct btrfs_root *root,
                        read_extent_buffer(leaf, p,
                                           item_off, item_len);
                        *sk_offset += item_len;
-                       found++;
                }
+               found++;
 
                if (*num_found >= sk->nr_items)
                        break;