Skip to content
  • Wang Shilong's avatar
    Btrfs: improve forever loop when doing balance relocation · 0647bf56
    Wang Shilong authored
    
    
    We hit a forever loop when doing balance relocation,the reason
    is that we firstly reserve 4M(node size is 16k).and within transaction
    we will try to add extra reservation for snapshot roots,this will
    return -EAGAIN if there has been a thread flushing space to reserve
    space.We will do this again and again with filesystem becoming nearly
    full.
    
    If the above '-EAGAIN' case happens, we try to refill reservation more
    outsize of transaction, and this will return eariler in enospc case,however,
    this dosen't really hurt because it makes no sense doing balance relocation
    with the filesystem nearly full.
    
    Miao Xie helped a lot to track this issue, thanks.
    
    Signed-off-by: default avatarWang Shilong <wangsl.fnst@cn.fujitsu.com>
    Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
    Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    0647bf56