diff options
author | Filipe Manana <fdmanana@suse.com> | 2023-05-04 13:04:26 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-06-19 13:59:24 +0200 |
commit | 7e5ba559941f011389936d49641304ed45e8b6a7 (patch) | |
tree | 1d206cba4f3ef1339600d1439f60b8a5d2f23c81 /fs/btrfs/scrub.c | |
parent | btrfs: assert tree lock is held when linking free space (diff) | |
download | linux-7e5ba559941f011389936d49641304ed45e8b6a7.tar.xz linux-7e5ba559941f011389936d49641304ed45e8b6a7.zip |
btrfs: assert tree lock is held when removing free space entries
Removing a free space entry from an in memory space cache requires having
the corresponding btrfs_free_space_ctl's 'tree_lock' held. We have several
code paths that remove an entry, so add assertions where appropriate to
verify we are holding the lock, as the lock is acquired by some other
function up in the call chain, which makes it easy to miss in the future.
Note: for this to work we need to lock the local btrfs_free_space_ctl at
load_free_space_cache(), which was not being done because it's local,
declared on the stack, so no other task has access to it.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
0 files changed, 0 insertions, 0 deletions