From eb32a4cf887c2a9390c502bd82ea3e41694d8630 Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Tue, 19 Apr 2022 13:02:37 +0200
Subject: [PATCH] More XFS madness fixes

---
 secondary.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/secondary.py b/secondary.py
index a973b8b..89b7c21 100644
--- a/secondary.py
+++ b/secondary.py
@@ -122,6 +122,9 @@ class Backup:
             stat = os.statvfs(self.dst_root)
             free = stat.f_frsize * stat.f_bavail
             need = size + stat.f_frsize
+            if stat.f_bavail == stat.f_bfree:
+                # Probably on xfs, make sure we alway have 1 MB extra
+                need += 1024*1024
             if path:
                 need += stat.f_frsize * len(path.split('/'))
             return (free, need)
-- 
GitLab