• Filipe Manana's avatar
    btrfs: don't steal space from global rsv after a transaction abort · 1b6948ac
    Filipe Manana authored
    
    
    When doing a priority metadata space reclaim, while we are going through
    the flush states and running their respective operations, it's possible
    that a transaction abort happened, for example when running delayed refs
    we hit -ENOSPC or in the critical section of transaction commit we failed
    with -ENOSPC or some other error. In these cases a transaction was aborted
    and the fs turned into error state. If that happened, then it makes no
    sense to steal from the global block reserve and return success to the
    caller if the stealing was successful - the caller will later get an
    error when attempting to modify the fs. Instead make the ticket fail if
    we have the fs in error state and don't attempt to steal from the global
    rsv, as it's not only it's pointless, it also simplifies debugging some
    -ENOSPC problems.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    1b6948ac
space-info.c 58.6 KB