Skip to content

common/platform_error.cc: Fix error 78 which is used in tests. - #71441

Draft
wjwithagen wants to merge 1 commit into
ceph:mainfrom
wjwithagen:wip-freebsd-errno-78
Draft

wjwithagen wants to merge 1 commit into
ceph:mainfrom
wjwithagen:wip-freebsd-errno-78

Conversation

@wjwithagen

@wjwithagen wjwithagen commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

wire errno 78 decoded to EPERM and re-encoded as 1, so errorcode32_t round-trips were lossy and callers testing for EPERM acted on an unrelated error; mapping it to ENOSYS (78 on FreeBSD) makes the round-trip lossless and fixes readable.sh on FreeBSD.

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

wire errno 78 decoded to EPERM and re-encoded as 1, so errorcode32_t
round-trips were lossy and callers testing for EPERM acted on an
unrelated error; mapping it to ENOSYS (78 on FreeBSD) makes the
round-trip lossless and fixes readable.sh on FreeBSD.

Signed-off-by: Willem Jan Withagen <[email protected]>
@wjwithagen wjwithagen added the FreeBSD Modifications specific for (only) FreeBSD label Aug 31, 2026
@tchaikov

Copy link
Copy Markdown
Contributor

already reviewed in #71442

H2C_ERRNO(EPROCUNAVAIL, EPERM), /* Bad procedure for program */
H2C_ERRNO(ENOLCK, EPERM), /* No locks available */
H2C_ERRNO(ENOSYS, EPERM), /* Function not implemented */
H2C_ERRNO(ENOSYS, 78), /* Function not implemented => ENOSYS on FreeBSD */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if we translate ENOSYS to 78, then a FreeBSD daemon that returns ENOSYS would return 78, and a linux peer reads 78 as EREMCHG.

probably we can just change H2C_ERRNO(ENOSYS, EPERM) to H2C_ERRNO(ENOSYS, 38), and leave C2H_ERRNO(78, EPERM) untouched.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common FreeBSD Modifications specific for (only) FreeBSD needs-rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants