From 8f3ec5dcaa6eb18d11746675190a7aaceb422764 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 21 Feb 2023 22:04:30 +0100 Subject: [PATCH] fusefrontend: unbreak isConsecutiveWrite streaming write optimization Commit 6196a5b5 got the logic inverted, hence we never set the last position markers. Fixes https://github.com/rfjakob/gocryptfs/issues/712 --- 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 ff26a6ee..8d0ba01b 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -384,7 +384,7 @@ func (f *File) Write(ctx context.Context, data []byte, off int64) (uint32, sysca } } n, errno := f.doWrite(data, off) - if errno != 0 { + if errno == 0 { f.lastOpCount = openfiletable.WriteOpCount() f.lastWrittenOffset = off + int64(len(data)) - 1 }