btrfs: return error pointer from alloc_test_extent_buffer
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Dec 2019 11:24:58 +0000 (14:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:41:57 +0000 (16:41 +0100)
commitaed46bbd426c2809287390263720a7cf5de52085
treecf3ef34f3853bff9c858c1a929ee3a3770cbc70d
parent2bfffc24dafe6d3d50b7df881f6af969a24c5050
btrfs: return error pointer from alloc_test_extent_buffer

commit b6293c821ea8fa2a631a2112cd86cd435effeb8b upstream.

Callers of alloc_test_extent_buffer have not correctly interpreted the
return value as error pointer, as alloc_test_extent_buffer should behave
as alloc_extent_buffer. The self-tests were unaffected but
btrfs_find_create_tree_block could call both functions and that would
cause problems up in the call chain.

Fixes: faa2dbf004e8 ("Btrfs: add sanity tests for new qgroup accounting code")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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/extent_io.c
fs/btrfs/tests/free-space-tree-tests.c
fs/btrfs/tests/qgroup-tests.c