Liu Bo 5e24e9af01 Btrfs: error out if generic_bin_search get invalid arguments
With btrfs-corrupt-block, one can set btree node/leaf's field, if
we assign a negative value to node/leaf, we can get various hangs,
eg. if extent_root's nritems is -2ULL, then we get stuck in
 btrfs_read_block_groups() because it has a while loop and
btrfs_search_slot() on extent_root will always return the first
 child.

This lets us know what's happening and returns a EINVAL to callers
instead of returning the first item.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2016-07-26 13:52:25 +02:00
..
2016-06-30 23:28:09 -04:00
2016-01-20 17:09:18 -08:00
2016-05-27 15:26:11 -07:00
2016-05-20 17:58:30 -07:00
2016-06-30 13:10:49 +02:00
2016-06-28 16:55:34 -04:00
2016-04-26 12:00:48 -04:00
2015-11-13 21:53:18 -08:00
2016-01-22 18:04:28 -05:00
2016-06-23 00:29:53 +02:00
2016-05-23 17:04:14 -07:00
2016-01-22 18:04:28 -05:00
2016-01-22 18:04:28 -05:00
2016-05-26 19:34:26 -07:00
2016-06-07 22:07:09 -04:00
2016-06-27 12:18:44 -07:00
2016-06-10 11:32:47 -04:00
2016-01-22 18:04:28 -05:00
2016-05-23 17:04:14 -07:00
2016-06-20 17:11:29 -04:00
2016-07-01 10:24:18 -04:00
2016-06-24 12:11:34 -04:00
2016-04-18 11:18:55 +02:00
2016-01-22 18:04:28 -05:00