• Chris Mason's avatar
    Btrfs: delete checksum items before marking blocks free · dcbdd4dc
    Chris Mason authored
    Btrfs maintains a cache of blocks available for allocation in ram.  The
    code that frees extents was marking the extents free and then deleting
    the checksum items.
    
    This meant it was possible the extent would be reallocated before the
    checksum item was actually deleted, leading to races and other
    problems as the checksums were updated for the newly allocated extent.
    
    The fix is to delete the checksum before marking the extent free.
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    dcbdd4dc
file-item.c 21.5 KB