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 locking #3251

Merged
merged 3 commits into from
Sep 20, 2022
Merged

Fix xattr locking #3251

merged 3 commits into from
Sep 20, 2022

Conversation

aduffeck
Copy link
Contributor

This PR fixes a potential race condition when listing xattrs of nodes in concurrency situations.

Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

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

ok, so we are now wrapping the list in a filelock

@butonic butonic merged commit c7033e6 into cs3org:edge Sep 20, 2022
@aduffeck aduffeck deleted the fix-xattr-locking branch September 20, 2022 07:48
@@ -191,17 +191,42 @@ func CopyMetadata(src, target string, filter func(attributeName string) bool) (e
// Set an extended attribute key to the given value
// No file locking is involved here as writing a single xattr is
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should be corrected.

}
}()

return xattr.Set(filePath, key, []byte(val))
}

// Remove an extended attribute key
// No file locking is involved here as writing a single xattr is
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

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.

3 participants