]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove no longer necessary chunk mutex locking cases
authorFilipe Manana <fdmanana@suse.com>
Mon, 1 Jun 2020 18:12:27 +0000 (19:12 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:21 +0000 (12:55 +0200)
commit3478bafaf3eeff6a7095819004905df5fad30a2c
treedd5ee968b8eb852c68a395b761b8c9021c12093d
parent8f97cd9f09ca8a8ea72a3e29c202a5b85b6c9c45
btrfs: remove no longer necessary chunk mutex locking cases

Initially when the 'removed' flag was added to a block group to avoid
races between block group removal and fitrim, by commit 5b6408bfe37f27
("Btrfs: fix race between fs trimming and block group remove/allocation"),
we had to lock the chunks mutex because we could be moving the block
group from its current list, the pending chunks list, into the pinned
chunks list, or we could just be adding it to the pinned chunks if it was
not in the pending chunks list. Both lists were protected by the chunk
mutex.

However we no longer have those lists since commit b62f87d97fa480
("btrfs: replace pending/pinned chunks lists with io tree"), and locking
the chunk mutex is no longer necessary because of that. The same happens
at btrfs_unfreeze_block_group(), we lock the chunk mutex because the block
group's extent map could be part of the pinned chunks list and the call
to remove_extent_mapping() could be deleting it from that list, which
used to be protected by that mutex.

So just remove those lock and unlock calls as they are not needed anymore.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c