diff options
author | Filipe Manana <fdmanana@suse.com> | 2021-02-04 17:35:44 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-04 12:26:44 +0300 |
commit | dca4f29507e4c5f955e49a78ca5a77a4382d0d3c (patch) | |
tree | ce0e8286436c057d86f8d02af2dec1bb3d4624a5 /block/blk.h | |
parent | df369c3afb0d138e43cae3ad82a54abfe80dbe18 (diff) | |
download | linux-dca4f29507e4c5f955e49a78ca5a77a4382d0d3c.tar.xz |
btrfs: fix extent buffer leak on failure to copy root
commit 72c9925f87c8b74f36f8e75a4cd93d964538d3ca upstream.
At btrfs_copy_root(), if the call to btrfs_inc_ref() fails we end up
returning without unlocking and releasing our reference on the extent
buffer named "cow" we previously allocated with btrfs_alloc_tree_block().
So fix that by unlocking the extent buffer and dropping our reference on
it before returning.
Fixes: be20aa9dbadc8c ("Btrfs: Add mount option to turn off data cow")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Filipe Manana <fdmanana@suse.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>
Diffstat (limited to 'block/blk.h')
0 files changed, 0 insertions, 0 deletions