diff options
author | Jakob Unterwurzacher | 2025-05-06 09:11:49 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2025-05-06 09:11:49 +0200 |
commit | 9b6e47fc0a2ed65d462424152a13f995a8d7dd9a (patch) | |
tree | dd3cdf0f52008f79f075df66a5f282de3b53c128 /internal/fusefrontend/root_node.go | |
parent | e59f97806b12d593b972bbd17988f061fcc09043 (diff) |
Switch to the new atomic Uint64.Add apiHEADnew_atomicmaster
The new api guarantees that the value is aligned, preventing
stuff like this on 32 bit platforms:
goroutine 26 [running]:
internal/runtime/atomic.panicUnaligned()
/usr/lib/go-1.24/src/internal/runtime/atomic/unaligned.go:8 +0x24
internal/runtime/atomic.Xadd64(0x2496c74, 0x1)
/usr/lib/go-1.24/src/internal/runtime/atomic/atomic_arm.s:318 +0x14
github.com/rfjakob/gocryptfs/internal/inomap.(*InoMap).NextSpillIno(0x2496c60)
Fixes https://github.com/rfjakob/gocryptfs/issues/912
Diffstat (limited to 'internal/fusefrontend/root_node.go')
-rw-r--r-- | internal/fusefrontend/root_node.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go index ac814ad..d2950a1 100644 --- a/internal/fusefrontend/root_node.go +++ b/internal/fusefrontend/root_node.go @@ -4,6 +4,7 @@ import ( "os" "strings" "sync" + "sync/atomic" "syscall" "time" @@ -55,7 +56,7 @@ type RootNode struct { // This makes each directory entry unique (even hard links), // makes go-fuse hand out separate FUSE Node IDs for each, and prevents // bizarre problems when inode numbers are reused behind our back. - gen uint64 + gen atomic.Uint64 // quirks is a bitmap that enables workaround for quirks in the filesystem // backing the cipherdir quirks uint64 |