From 7624502ec451c1ef1021cbd1a0dd714ee89aed11 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 24 Sep 2020 21:19:46 -0700 Subject: [PATCH] Don't swap the int and cause a negative disk space... closes pterodactyl/panel#2401 --- server/filesystem.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/filesystem.go b/server/filesystem.go index 0246478..b0a843c 100644 --- a/server/filesystem.go +++ b/server/filesystem.go @@ -704,7 +704,7 @@ func (fs *Filesystem) Delete(p string) error { } } else { if !st.IsDir() { - atomic.SwapInt64(&fs.disk, -st.Size()) + atomic.AddInt64(&fs.disk, -st.Size()) } else { go func(st os.FileInfo, resolved string) { if s, err := fs.DirectorySize(resolved); err == nil {