Skip to content
  • Chris Mason's avatar
    Btrfs: fix fallocate deadlock on inode extent lock · e980b50c
    Chris Mason authored
    
    
    The btrfs fallocate call takes an extent lock on the entire range
    being fallocated, and then runs through insert_reserved_extent on each
    extent as they are allocated.
    
    The problem with this is that btrfs_drop_extents may decide to try
    and take the same extent lock fallocate was already holding.  The solution
    used here is to push down knowledge of the range that is already locked
    going into btrfs_drop_extents.
    
    It turns out that at least one other caller had the same bug.
    
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    e980b50c