From b11aeec30866fe97b3c23488d51a47a040991b04 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 30 Dec 2024 12:08:41 +0100 Subject: fusefrontend: sharedstorage: lock truncate agains concurrent access Prevent reads and writes concurrent with the truncate operation. It's racy on tmpfs and ext4 ( https://lore.kernel.org/all/18e9fa0f-ec31-9107-459c-ae1694503f87@gmail.com/t/ ) as evident by TestOpenTruncate test failures: === RUN TestOpenTruncate cluster_test.go:209: POSIX compliance issue: non-exlusive create failed with err=file exists doRead 16384215: corrupt block #0: cipher: message authentication failed ino16384215 fh8: RMW read failed: errno=5 cluster_test.go:214: iteration 1: WriteAt: write /tmp/gocryptfs-test-parent-1026/1358464214/TestOpenTruncate.1788296708.mnt2/foo: input/output error --- FAIL: TestOpenTruncate (0.06s) FAIL exit status 1 FAIL github.com/rfjakob/gocryptfs/v2/tests/cluster 7.880s Relates-to: https://github.com/rfjakob/gocryptfs/issues/56 --- go.mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'go.mod') diff --git a/go.mod b/go.mod index 63ac969..eaea519 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,13 @@ go 1.19 require ( github.com/aperturerobotics/jacobsa-crypto v1.0.2 - github.com/hanwen/go-fuse/v2 v2.5.0 + github.com/hanwen/go-fuse/v2 v2.7.2 github.com/moby/sys/mountinfo v0.6.2 github.com/pkg/xattr v0.4.9 github.com/rfjakob/eme v1.1.2 github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 github.com/spf13/pflag v1.0.5 - golang.org/x/crypto v0.18.0 - golang.org/x/sys v0.16.0 - golang.org/x/term v0.16.0 + golang.org/x/crypto v0.31.0 + golang.org/x/sys v0.28.0 + golang.org/x/term v0.27.0 ) -- cgit v1.2.3