]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: set range_start to the right start in count_range_bits
authorJosef Bacik <josef@redhat.com>
Wed, 4 May 2011 15:11:17 +0000 (11:11 -0400)
committerJosef Bacik <josef@redhat.com>
Mon, 23 May 2011 17:03:09 +0000 (13:03 -0400)
commitc74083a04eca882b57e82a64c4e26f2f687b4ede
tree499aaa2a1ca372816885752fcd1769e3e9a0487a
parent1526f6fb5e0a57a8560c7bcb225c5528d33db934
Btrfs: set range_start to the right start in count_range_bits

In count_range_bits we are adjusting total_bytes based on the range we are
searching for, but we don't adjust the range start according to the range we are
searching for, which makes for weird results.  For example, if the range

[0-8192]

is set DELALLOC, but I search for 4096-8192, I will get back 4096 for the number
of bytes found, but the range_start will be 0, which makes it look like the
range is [0-4096].  So instead set range_start = max(cur_start, state->start).
This makes everything come out right.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
fs/btrfs/extent_io.c