Skip to content
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: xattr table index to split position into decompressed and compressed offset #277

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

jonathongardner
Copy link
Contributor

fixes: /issues/276

//nolint:unparam,unused,revive // this does not use offset or compressor yet, but only because we have not yet added support
func parseXattrsTable(bUIDXattr, bIndex []byte, offset uint64, c Compressor) (*xAttrTable, error) {
//nolint:unparam,unused,revive // this does not use compressor yet, but only because we have not yet added support
func parseXattrsTable(bUIDXattr, bIndex []byte, offsetMap map[uint32]uint32, c Compressor) (*xAttrTable, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this was the plan for offset but I replaced it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better. You can see the comment. Does it no longer need the nolint comments? Or is c Compressor still unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah Compressor is still unused, I can remove it if you want

deitch
deitch previously approved these changes Jan 17, 2025
Copy link
Collaborator

@deitch deitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thank you.

@deitch
Copy link
Collaborator

deitch commented Jan 17, 2025

Strange that this fails lint on what you did not touch. I will look.

@deitch
Copy link
Collaborator

deitch commented Jan 17, 2025

This is the oddest thing. I am running the same version of golangci-lint (v1.61.0), the same minor versions of go (tried with v1.23.0 and v1.23.1, while CI is running v1.23.4), and yet I do not see that lint complaint.

@deitch
Copy link
Collaborator

deitch commented Jan 17, 2025

OK, now I got it. It only seems to occur on your branch, even though you didn't change that file. I don't know why. Either way, can you put in a nolint comment on it to clear it? Just run make lint locally until it clears.

@@ -68,7 +68,7 @@ func TestValidateBlocksize(t *testing.T) {

func TestParseXAttrsTable(t *testing.T) {
// parseXattrsTable(bUIDXattr, bIndex []byte, offset uint64, c compressor) (*xAttrTable, error) {
b, offset, err := testGetInodeMetabytes()
b, _, err := testGetInodeMetabytes()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh this is why linting is failing, looks like this was the only place using the offset

@deitch
Copy link
Collaborator

deitch commented Jan 19, 2025

Now it's happy. Thanks!

@deitch deitch merged commit 05f792d into diskfs:master Jan 19, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when trying to load a squashfs file
2 participants