Btrfs: fix use after free when close_ctree frees the orphan_rsv
authorChris Mason <clm@fb.com>
Tue, 7 Apr 2015 01:17:00 +0000 (18:17 -0700)
committerChris Mason <clm@fb.com>
Fri, 10 Apr 2015 21:07:29 +0000 (14:07 -0700)
commitcdfb080e1853660952db5e5332727e59427856df
tree43c59bd16f29e6e8fb9ff045ce20a16a4275c715
parent1bbc621ef28462456131c035eaeb5567a1a2a2fe
Btrfs: fix use after free when close_ctree frees the orphan_rsv

Near the end of close_ctree, we're calling btrfs_free_block_rsv
to free up the orphan rsv.  The problem is this call updates the
space_info, which has already been freed.

This adds a new __ function that directly calls kfree instead of trying
to update the space infos.

Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c