aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend/file_holes.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/file_holes.go')
-rw-r--r--internal/fusefrontend/file_holes.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/fusefrontend/file_holes.go b/internal/fusefrontend/file_holes.go
index 46a5865..1d9a5fb 100644
--- a/internal/fusefrontend/file_holes.go
+++ b/internal/fusefrontend/file_holes.go
@@ -22,6 +22,10 @@ func (f *file) createsHole(plainSize uint64, off int64) bool {
func (f *file) zeroPad(plainSize uint64) fuse.Status {
lastBlockLen := plainSize % f.contentEnc.PlainBS()
missing := f.contentEnc.PlainBS() - lastBlockLen
+ if missing == 0 {
+ // Already block-aligned
+ return fuse.OK
+ }
pad := make([]byte, missing)
tlog.Debug.Printf("zeroPad: Writing %d bytes\n", missing)
_, status := f.doWrite(pad, int64(plainSize))