Skip to content

Conversation

@anoopcs9
Copy link
Collaborator

@anoopcs9 anoopcs9 commented Jun 5, 2025

Create backward compatible wrappers to cope with the change in ABI for chown family of APIs counting on the implicit type conversion from C.

fixes #1119

@anoopcs9 anoopcs9 force-pushed the fix-chown-abi-change branch from 82c4157 to 19b39bc Compare June 5, 2025 18:18
@phlogistonjohn
Copy link
Collaborator

OK, so Go is being pickier than C is in this case? OK seems reasonable. I still think it was a good idea to warn the cephfs team so we don't get disruptive changes in the future.

@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Jun 5, 2025

OK, so Go is being pickier than C is in this case? OK seems reasonable. I still think it was a good idea to warn the cephfs team so we don't get disruptive changes in the future.

Yes.

@anoopcs9 anoopcs9 force-pushed the fix-chown-abi-change branch from 19b39bc to b329416 Compare June 5, 2025 18:46
@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Jun 5, 2025

Something is wrong with GitHub CI. I'll check later.

@anoopcs9 anoopcs9 marked this pull request as ready for review June 6, 2025 04:34
@anoopcs9
Copy link
Collaborator Author

anoopcs9 commented Jun 6, 2025

@Mergifyio rebase

anoopcs9 added 2 commits June 6, 2025 04:34
CephStatx struct returned by mount.Statx() already contains uint32 type
converted Uid and Gid data members.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
Data types for few of the function parameters from chown() family of
APIs recently changed causing cephfs package builds to fail due to
incorrect type cast.

cephfs/file.go:287:99: cannot use _Ctype_int(user) (value of int32 type
        _Ctype_int) as _Ctype_uid_t value in variable declaration
cephfs/file.go:287:112: cannot use _Ctype_int(group) (value of int32 type
        _Ctype_int) as _Ctype_gid_t value in variable declaration
cephfs/permissions.go:29:67: cannot use _Ctype_int(user) (value of int32 type
        _Ctype_int) as _Ctype_uid_t value in variable declaration
cephfs/permissions.go:29:80: cannot use _Ctype_int(group) (value of int32 type
        _Ctype_int) as _Ctype_gid_t value in variable declaration
cephfs/permissions.go:38:68: cannot use _Ctype_int(user) (value of int32 type
        _Ctype_int) as _Ctype_uid_t value in variable declaration
cephfs/permissions.go:38:81: cannot use _Ctype_int(group) (value of int32 type
        _Ctype_int) as _Ctype_gid_t value in variable declaration

Leaning on C's implicit type conversion, introduce wrappers to act as an
intermediary for calling the underlying APIs.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
@mergify
Copy link

mergify bot commented Jun 6, 2025

rebase

✅ Branch has been successfully rebased

@anoopcs9 anoopcs9 force-pushed the fix-chown-abi-change branch from b329416 to 19f29a7 Compare June 6, 2025 04:34
Copy link
Member

@nixpanic nixpanic left a comment

Choose a reason for hiding this comment

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

I'm a little surprised this doesn't throw a warning, but I like its simplicity. Thanks!

Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

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

looks ok to me

@phlogistonjohn phlogistonjohn added the no-API This PR does not include any changes to the public API of a go-ceph package label Jun 6, 2025
@mergify mergify bot merged commit 3033d98 into ceph:master Jun 6, 2025
14 of 16 checks passed
@anoopcs9 anoopcs9 deleted the fix-chown-abi-change branch June 7, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-API This PR does not include any changes to the public API of a go-ceph package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cephfs pkg fails to build on ceph main

3 participants