-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vaultfs): Fix 32-bit panic #720
Conversation
Signed-off-by: Dave Henderson <[email protected]>
WalkthroughThe Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
#718 isn't merged yet, so I can't test this in CI, but I've tested it in a VM: $ make test GOARCH=386
CGO_ENABLED=0 go test -coverprofile=c.out ./...
ok github.com/hairyhenderson/go-fsimpl 0.042s coverage: 81.8% of statements
? github.com/hairyhenderson/go-fsimpl/examples [no test files]
github.com/hairyhenderson/go-fsimpl/internal/tests coverage: 0.0% of statements
ok github.com/hairyhenderson/go-fsimpl/autofs 0.312s coverage: 86.7% of statements
ok github.com/hairyhenderson/go-fsimpl/awsimdsfs 1.514s coverage: 76.0% of statements
ok github.com/hairyhenderson/go-fsimpl/awssmfs 0.270s coverage: 79.8% of statements
ok github.com/hairyhenderson/go-fsimpl/awssmpfs 0.295s coverage: 77.5% of statements
ok github.com/hairyhenderson/go-fsimpl/blobfs 1.013s coverage: 78.3% of statements
ok github.com/hairyhenderson/go-fsimpl/consulfs 0.350s coverage: 84.2% of statements
ok github.com/hairyhenderson/go-fsimpl/examples/fscli 0.329s coverage: 23.3% of statements
ok github.com/hairyhenderson/go-fsimpl/filefs 0.325s coverage: 95.5% of statements
ok github.com/hairyhenderson/go-fsimpl/gitfs 1.112s coverage: 86.9% of statements
ok github.com/hairyhenderson/go-fsimpl/httpfs 0.309s coverage: 65.8% of statements
ok github.com/hairyhenderson/go-fsimpl/internal 0.145s coverage: 37.1% of statements
ok github.com/hairyhenderson/go-fsimpl/internal/billyadapter 0.261s coverage: 88.1% of statements
ok github.com/hairyhenderson/go-fsimpl/internal/env 0.243s coverage: 100.0% of statements
ok github.com/hairyhenderson/go-fsimpl/internal/tests/integration 8.982s coverage: 75.0% of statements
ok github.com/hairyhenderson/go-fsimpl/tracefs 0.269s coverage: 75.0% of statements
ok github.com/hairyhenderson/go-fsimpl/vaultfs 0.127s coverage: 79.1% of statements
ok github.com/hairyhenderson/go-fsimpl/vaultfs/vaultauth 0.059s coverage: 49.2% of statements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- vaultfs/client.go (2 hunks)
Additional comments not posted (4)
vaultfs/client.go (4)
21-21
: Approved modification ofrefs
field type.Changing from
uint64
toatomic.Uint64
addresses alignment issues on 32-bit systems and ensures thread-safe operations.
27-27
: Approved update toAddRef
method.Using
atomic.Uint64
'sAdd
method for incrementing is appropriate and thread-safe.
39-39
: Approved update toRemoveRef
method.Using
atomic.Uint64
'sAdd
method with^uint64(0)
to decrement is correct and ensures atomicity.
43-43
: Approved addition ofRefs
method.The method correctly uses
atomic.Uint64
'sLoad
to safely retrieve the current reference count.
Fixes #719
The struct wasn't on a 64-bit offset, which is why it was panicking. However, we can use
atomic.Uint64
now, which totally avoids this problem, so I've switched to that instead.Summary by CodeRabbit