From 1d7dd0a76c15cf8c0dffef918a6b6c3dcb6347c4 Mon Sep 17 00:00:00 2001 From: Alex Shumsky Date: Thu, 7 Mar 2024 23:33:11 +0300 Subject: fusefrontend: fix excessive file fragmentation on BTRFS --- internal/fusefrontend/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 8d0ba01..0e25de3 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -316,7 +316,7 @@ func (f *File) doWrite(data []byte, off int64) (uint32, syscall.Errno) { if cOff > math.MaxInt64 { return 0, syscall.EFBIG } - if !f.rootNode.args.NoPrealloc { + if !f.rootNode.args.NoPrealloc && f.rootNode.quirks&syscallcompat.QuirkBrokenFalloc == 0 { err = syscallcompat.EnospcPrealloc(f.intFd(), int64(cOff), int64(len(ciphertext))) if err != nil { if !syscallcompat.IsENOSPC(err) { -- cgit v1.2.3