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

FreeBSD xattr support #3650

Merged
merged 4 commits into from
Feb 14, 2023
Merged

FreeBSD xattr support #3650

merged 4 commits into from
Feb 14, 2023

Conversation

joramkruijer
Copy link

Since #3559, reva compiles perfectly fine on FreeBSD, but runs into problems with the xattr on FreeBSD:

Failed to set all xattrs: xattr.Set user.ocis.blobsize: invalid argument

This MR adds support for FreeBSD's xattr namespaces. On Linux, every namespace is accessible, but in FreeBSD (and in FreeBSD jails) this is not the case: the user part of the namespace is the only namespace writable, and is the implied namespace.

Setting a namespace manually, i.e. user.ocis will have the system refuse to use said namespace. Omitting the user. part of the namespace on FreeBSD solves this bug. The complete namespace will still be user.ocis, as FreeBSD prepends this part automatically.

Many thanks to @BlackNovaTech for help with the debugging.

BlackNovaTech and others added 2 commits January 31, 2023 20:21
There is a slight compatibilty issue due to FreeBSD disallowing
usage of the `user.` prefix when it comes to xattr names.
Just for FreeBSD this patch removes that `user.` prefix (leaving
`ocis.`) which allows it to run on FreeBSD.
@joramkruijer joramkruijer requested a review from a team as a code owner February 12, 2023 16:46
@micbar
Copy link
Member

micbar commented Feb 12, 2023

@joramkruijer Thanks for the PR!

@butonic FYI

@butonic
Copy link
Contributor

butonic commented Feb 13, 2023

@joramkruijer nice deep dive into the bowels, I guess! Could you add a changelog file in changelog/unreleased? Maybe changelog/unreleased/freebsd-xattr-support.md:

Bugfix: FreeBSD xattr support

We now properly handle FreeBSD xattr namespaces by leaving out the `user.` prefix. FreeBSD adds that automatically.

https://github.com/cs3org/reva/pull/3650

@butonic butonic added the bug Something isn't working label Feb 13, 2023
@joramkruijer
Copy link
Author

@butonic Thanks, it sure was an interesting thing to solve! I've added the changelog entry you proposed, I think it covers the fix perfectly.

@butonic butonic merged commit ec27f5f into cs3org:edge Feb 14, 2023
@micbar micbar mentioned this pull request May 3, 2023
89 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants