]> 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, 23 Jan 2015 13:21:51 +0000 (08:21 -0500)
commit3811a1874095d78bbddea50ab5638654993ab4f4
tree188b2348bbffd1e9b0c8e4e2085fda71eab82438
parente3cc4b0cacbb4a081a6fc27be33efa05c80e7c20
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