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

API to get group information and to change file ownership #2314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

muthu90tech
Copy link

The scylladb codebase is bypassing seastar api to make syscalls directly, instead add seastar APIs for those syscall and use it in the transport/controller.cc in scylla
see issue: scylladb/scylladb#17443

src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
include/seastar/core/reactor.hh Outdated Show resolved Hide resolved
include/seastar/core/file.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch 2 times, most recently from 9899bb3 to 25ca367 Compare July 5, 2024 07:41
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@tchaikov
Copy link
Contributor

@muthu90tech please resolve the conflicts and repush.

@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch 3 times, most recently from bbf24d2 to 5424c1d Compare August 17, 2024 04:59
@muthu90tech
Copy link
Author

@muthu90tech please resolve the conflicts and repush.

rebased instead of merge commit.

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

we are closer =)

left a couple comments.

include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

lgtm

@tchaikov
Copy link
Contributor

@scylladb/seastar-maint hello maintainers, could you help review this change?

include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@nyh
Copy link
Contributor

nyh commented Sep 3, 2024

@muthu90tech when you push a new version and ask for a review, please write a comment saying what you changed from the previous version.

src/core/syscall_result.hh Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
Copy link
Author

@muthu90tech muthu90tech left a comment

Choose a reason for hiding this comment

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

changes made:

  1. Made the ec() method public in seastar/src/core/syscall_result.hh > syscall_result
  2. Modified the test, to assert on error code as well
  3. the memset on buf not needed as getgrnam only writes to it.
  4. removed unnecessary var to hold buffer length.

Commit Sep 15:
@nyh
After reading comments from @avikivity , I have created a separate seastar specific group struct and named it group_details

src/seastar.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@@ -61,6 +61,14 @@ struct directory_entry {
std::optional<directory_entry_type> type;
};

Copy link
Member

@avikivity avikivity Sep 17, 2024

Choose a reason for hiding this comment

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

Add APIs to get group details and to change ownership of file.

Please enrich the patch changelog with the details.

Copy link
Author

@muthu90tech muthu90tech Sep 17, 2024

Choose a reason for hiding this comment

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

Add APIs to get group details and to change ownership of file.

Please enrich the patch changelog with the details.

Thanks @avikivity , I have added details to the commit log

There are a few calls in scylladb that bypass Seastar APIs when making libc
and syscall (getgrnam, chown), see issue scylladb/scylladb#17443.

This commit implements those APIs, which can be used to address the
issue scylladb/scylladb#17443
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.

4 participants