summaryrefslogtreecommitdiff
path: root/samples/uhid
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2019-10-15 12:54:39 +0300
committerDavid Sterba <dsterba@suse.com>2019-10-17 21:13:44 +0300
commitc7967fc1499beb9b70bb9d33525fb0b384af8883 (patch)
tree51d003e83e940287aea5b7362c2aad557108690a /samples/uhid
parent1b2442b4ae0f234daeadd90e153b466332c466d8 (diff)
downloadlinux-c7967fc1499beb9b70bb9d33525fb0b384af8883.tar.xz
Btrfs: fix qgroup double free after failure to reserve metadata for delalloc
If we fail to reserve metadata for delalloc operations we end up releasing the previously reserved qgroup amount twice, once explicitly under the 'out_qgroup' label by calling btrfs_qgroup_free_meta_prealloc() and once again, under label 'out_fail', by calling btrfs_inode_rsv_release() with a value of 'true' for its 'qgroup_free' argument, which results in btrfs_qgroup_free_meta_prealloc() being called again, so we end up having a double free. Also if we fail to reserve the necessary qgroup amount, we jump to the label 'out_fail', which calls btrfs_inode_rsv_release() and that in turns calls btrfs_qgroup_free_meta_prealloc(), even though we weren't able to reserve any qgroup amount. So we freed some amount we never reserved. So fix this by removing the call to btrfs_inode_rsv_release() in the failure path, since it's not necessary at all as we haven't changed the inode's block reserve in any way at this point. Fixes: c8eaeac7b73434 ("btrfs: reserve delalloc metadata differently") CC: stable@vger.kernel.org # 5.2+ Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'samples/uhid')
0 files changed, 0 insertions, 0 deletions