• Filipe Manana's avatar
    Btrfs: ensure deletion from pinned_chunks list is protected · a1e7e16e
    Filipe Manana authored
    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: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    a1e7e16e
free-space-cache.c 87 KB