summary refs log tree commit diff
path: root/fs/9p/xattr.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2017-12-13 13:50:07 +0200
committerDavid Sterba <dsterba@suse.com>2018-01-02 18:00:13 +0100
commitbeed9263f4000c48a5c48912f26576f6fa091181 (patch)
tree655a1228428a5a192894a942af10c21ba396e2ff /fs/9p/xattr.c
parentc8bcbfbd239ed60a6562964b58034ac8a25f4c31 (diff)
downloadlinux-beed9263f4000c48a5c48912f26576f6fa091181.tar.gz
btrfs: Fix flush bio leak
Commit e0ae99941423 ("btrfs: preallocate device flush bio") reworked
the way the flush bio is allocated and used. Concretely it allocates
the bio in __alloc_device and then re-uses it multiple times with a
very simple endio routine that just calls complete() without consuming
a reference. Allocated bios by default come with a ref count of 1,
which is then consumed by the endio routine (or not, in which case they
should be bio_put by the caller). The way the impleementation works now
is that the flush bio has a refcount of 2 and we only ever bio_put it
once, leaving it to hang indefinitely. Fix this by removing the extra
bio_get in __alloc_device.

Fixes: e0ae99941423 ("btrfs: preallocate device flush bio")
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/9p/xattr.c')
0 files changed, 0 insertions, 0 deletions