aboutsummaryrefslogtreecommitdiff
path: root/fs/jbd2/commit.c
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2021-01-25 16:42:35 -0500
committerDavid Sterba <[email protected]>2021-02-22 18:07:45 +0100
commit95c85fba1f64c3249c67f0078a29f8a125078189 (patch)
tree94759fd6b4bb04faa4daabca4a1c75583be1757d /fs/jbd2/commit.c
parent3660d0bcdb82807d434da9d2e57d88b37331182d (diff)
btrfs: avoid double put of block group when emptying cluster
It's wrong calling btrfs_put_block_group in __btrfs_return_cluster_to_free_space if the block group passed is different than the block group the cluster represents. As this means the cluster doesn't have a reference to the passed block group. This results in double put and a use-after-free bug. Fix this by simply bailing if the block group we passed in does not match the block group on the cluster. Fixes: fa9c0d795f7b ("Btrfs: rework allocation clustering") CC: [email protected] # 4.4+ Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> [ update changelog ] Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions