]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Transpose btrfs_close_devices/btrfs_mapping_tree_free in close_ctree
authorNikolay Borisov <nborisov@suse.com>
Tue, 12 Feb 2019 14:13:14 +0000 (16:13 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:37 +0000 (19:02 +0200)
commit8dd3617b9caf2f9f696ca89b42a559864b42ff13
tree07b0803b3cb0c9c614a541d4d8e42378bc22f479
parent4ff4d0adc169fb32f6e9d42f7b90b828c043ee54
btrfs: Transpose btrfs_close_devices/btrfs_mapping_tree_free in close_ctree

Following the introduction of the alloc_state tree, some of the callees
of btrfs_mapping_tree_free will have to interact with the btrfs_device
of the constituent devices. Enable this by moving the code responsible
for freeing devices after the last user (btrfs_mapping_tree_free).
Otherwise the kernel could crash due to use-after-free.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c