]> git.hungrycats.org Git - linux/commit
Btrfs: ensure deletion from pinned_chunks list is protected
authorFilipe Manana <fdmanana@suse.com>
Thu, 4 Dec 2014 15:31:01 +0000 (15:31 +0000)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Fri, 19 Dec 2014 15:25:14 +0000 (10:25 -0500)
commit71639c08e3eca3da61471d08efdf73933d077af1
tree02152f88e01d8ea340a4097a30bcfe3ad8ed397f
parentb2057f90267aa2e963582721e8809d8bf1a522f9
Btrfs: ensure deletion from pinned_chunks list is protected

The call to remove_extent_mapping() actually deletes the extent map
from the list it's included in - fs_info->pinned_chunks - and that
list is protected by the chunk mutex. Therefore make that call
while holding the chunk mutex and remove the redundant list delete
call because it's a noop.

This fixes an overlook of the patch titled
"Btrfs: fix race between fs trimming and block group remove/allocation"
following the same obvervation from the patch titled
"Btrfs: fix unprotected deletion from pending_chunks list".

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit a1e7e16ed36b9b059c5ee94e372287418e2dc7bc)
fs/btrfs/free-space-cache.c