• Josef Bacik's avatar
    btrfs: run delayed iputs when flushing delalloc · 2d344726
    Josef Bacik authored
    We have transient failures with btrfs/301, specifically in the part
    where we do
    
      for i in $(seq 0 10); do
    	  write 50m to file
    	  rm -f file
      done
    
    Sometimes this will result in a transient quota error, and it's because
    sometimes we start writeback on the file which results in a delayed
    iput, and thus the rm doesn't actually clean the file up.  When we're
    flushing the quota space we need to run the delayed iputs to make sure
    all the unlinks that we think have completed have actually completed.
    This removes the small window where we could fail to find enough space
    in our quota.
    
    CC: stable@vger.kernel.org # 5.15+
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    2d344726
qgroup.c 131 KB