btrfs: set max_extent_size properly
authorJosef Bacik <jbacik@fb.com>
Fri, 12 Oct 2018 19:32:33 +0000 (15:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:15:15 +0000 (11:15 -0800)
commit65d41e98fd715f93b9d79e4583fdb5db7a176c44
treea672f39ad44df96f95ec2c501c555837ee70e71f
parent947a9b021baf0521a12b1895c81507d7f5c2ddbe
btrfs: set max_extent_size properly

commit ad22cf6ea47fa20fbe11ac324a0a15c0a9a4a2a9 upstream.

We can't use entry->bytes if our entry is a bitmap entry, we need to use
entry->max_extent_size in that case.  Fix up all the logic to make this
consistent.

CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/free-space-cache.c