cephfs.pyx: handle when UID/GID passed to chown() is -1#64999
cephfs.pyx: handle when UID/GID passed to chown() is -1#64999rishabh-d-dave merged 2 commits intoceph:mainfrom
Conversation
97c0516 to
63e0aa1
Compare
|
. |
63e0aa1 to
f6855b8
Compare
batrick
left a comment
There was a problem hiding this comment.
Good work. Please add a comment to the conversion noting this works around:
OverflowError: can't convert negative value to gid_t .
When chown() in libcephfs call receives -1 as the value of UID/GID, it is implicitly converted from signed integer to unsigned integeer but CephFS cython instead of doing that errors out during complilation. Therefore make this conversion explicitly to allow users to pass -1 (which they do to indicate that UID/GID value shouldn't be changed) and also for sake of uniformity and consistency between between CephFS cython and libcephfs interface. Fixes: https://tracker.ceph.com/issues/72547 Introduced-by: 65328ac Signed-off-by: Rishabh Dave <ridave@redhat.com>
f6855b8 to
2c2b33c
Compare
Done. |
Signed-off-by: Rishabh Dave <ridave@redhat.com>
2c2b33c to
069bede
Compare
|
fs:libcephfs ran succesfully - https://pulpito.ceph.com/rishabh-2025-08-13_10:14:02-fs:libcephfs-rishabh-fs-pyx-chown-2-testing-default-smithi/ |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check arm64 |
|
jenkins test make check |
|
This PR is under test in https://tracker.ceph.com/issues/72684. |
|
jenkins retest this please |
|
jenkins test make check arm64 |
|
jenkins test api |
|
@vshankar CI is green, can we merge this PR? |
Run test_python.sh with non-root user. This makes it necessary to change the owner user and group of file system root to be same as this non-root user. This brings testing closer to the real-world scenario and also allows exercising negative tests where an FS op would fail for a non-root user but it would pass for root user. There are few tests that exercise FS operations where root user is needed. Group these tests under a separate class and add extra code for this class that allows these tests to run with root UID and GID. Signed-off-by: Rishabh Dave <ridave@redhat.com> (cherry picked from commit 6021dda) Conflicts: src/test/pybind/test_cephfs.py - PR ceph#64999 is merged in main but not in Squid, causing this branch to have less tests that need to be moved to class TestWithRootUser.
Run test_python.sh with non-root user. This makes it necessary to change the owner user and group of file system root to be same as this non-root user. This brings testing closer to the real-world scenario and also allows exercising negative tests where an FS op would fail for a non-root user but it would pass for root user. There are few tests that exercise FS operations where root user is needed. Group these tests under a separate class and add extra code for this class that allows these tests to run with root UID and GID. Signed-off-by: Rishabh Dave <ridave@redhat.com> (cherry picked from commit 6021dda) Conflicts: src/test/pybind/test_cephfs.py - PR ceph#64999 is merged in main but not in Reef (bug is absent in Reef), causing this file to have less tests that need to be moved to class TestWithRootUser.
When chown() in libcephfs call receives -1 as the value of UID/GID, it
is implicitly converted from signed integer to unsigned integeer but
CephFS cython instead of doing that errors out during complilation.
Therefore make this conversion explicitly to allow users to pass -1
(which they do to indicate that UID/GID value shouldn't be changed) and
also for sake of uniformity and consistency between between CephFS
cython and libcephfs interface.
Fixes: https://tracker.ceph.com/issues/72547
Introduced-by: 65328ac, PR #62934.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition