• Josef Bacik's avatar
    Btrfs: do not release more reserved bytes to the global_block_rsv than we need · e9e22899
    Josef Bacik authored
    When we do btrfs_block_rsv_release, if global_block_rsv is not full we will
    release all the extra bytes to global_block_rsv, even if it's only a little
    short of the amount of space that we need to reserve.  This causes us to starve
    ourselves of reservable space during the transaction which will force us to
    shrink delalloc bytes and commit the transaction more often than we should.  So
    instead just add the amount of bytes we need to add to the global reserve so
    reserved == size, and then add the rest back into the space_info for general
    use.  Thanks,
    Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    e9e22899
extent-tree.c 227 KB