]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add missing device::flush_bio puts
authorDavid Sterba <dsterba@suse.com>
Mon, 30 Oct 2017 17:36:08 +0000 (18:36 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 15 Nov 2017 13:45:26 +0000 (14:45 +0100)
commitaaac1ea5bd02c34fff3291f44dd3ebc8351ed49a
tree80fea504120e32bee7d599cdb4e65a29f41da829
parent2fb48fdd8e4ac0dd678828cf415ee36e38a94d4f
btrfs: add missing device::flush_bio puts

This fixes potential bio leaks, in several error paths. Unfortunatelly
the device structure freeing is opencoded in many places and I missed
them when introducing the flush_bio.

Most of the time, devices get freed through call_rcu(..., free_device),
so it at least it's not that easy to hit the leak, but it's still
possible through the path that frees stale devices.

Fixes: b8bb3e22a4be ("btrfs: preallocate device flush bio")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c