Re: [PATCH] btrfs: use correct types for page indices in btrfs_page_exists_in_range

2017-05-18 Thread Liu Bo
On Wed, May 17, 2017 at 04:00:35PM +0200, David Sterba wrote: > Variables start_idx and end_idx are supposed to hold a page index > derived from the file offsets. The int type is not the right one though, > offsets larger than 1 << 44 will get silently trimmed off the high bits. > (1 << 44 is

[PATCH] btrfs: use correct types for page indices in btrfs_page_exists_in_range

2017-05-17 Thread David Sterba
Variables start_idx and end_idx are supposed to hold a page index derived from the file offsets. The int type is not the right one though, offsets larger than 1 << 44 will get silently trimmed off the high bits. (1 << 44 is 16TiB) What can go wrong, if start is below the boundary and end gets