Skip to content

erasure-code/isa: Handle case where data and coding buffers are not 3…#59862

Merged
yuriw merged 1 commit intoceph:mainfrom
jamiepryde:isa-xor-handle-misaligned-buffers
Dec 3, 2024
Merged

erasure-code/isa: Handle case where data and coding buffers are not 3…#59862
yuriw merged 1 commit intoceph:mainfrom
jamiepryde:isa-xor-handle-misaligned-buffers

Conversation

@jamiepryde
Copy link
Contributor

…2-byte aligned

#58594 updated isa_encode() to use ISA's xor_gen() function as an optimisation when m=1. That PR missed the case where the data and coding buffers are not aligned to 32 bytes. Passing misaligned buffers to xor_gen() can result in a segmentation fault.

This PR checks the alignment of the buffers and only uses xor_gen() if the buffers are 32-byte aligned. I have also restored the byte_xor() function that was removed in 58594. If buffers are not aligned, then byte_xor() will be used instead of xor_gen().

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@jamiepryde jamiepryde self-assigned this Sep 18, 2024
@jamiepryde jamiepryde requested a review from a team as a code owner September 18, 2024 16:21
@github-actions github-actions bot added the core label Sep 18, 2024
@jamiepryde
Copy link
Contributor Author

jenkins test api

…2-byte aligned

Signed-off-by: Jamie Pryde <jamiepry@uk.ibm.com>
@jamiepryde jamiepryde force-pushed the isa-xor-handle-misaligned-buffers branch from 261941f to 524dabc Compare September 19, 2024 12:40
@markhpc
Copy link
Member

markhpc commented Sep 26, 2024

@perezjosibm Heya! Given that you've read over the code... If you are satisfied, would you be willing to approve the PR and add the needs-qa flag?

Thanks!

@markhpc
Copy link
Member

markhpc commented Oct 3, 2024

retest this please

@jamiepryde
Copy link
Contributor Author

jenkins test make check

@jamiepryde
Copy link
Contributor Author

jenkins test make check

1 similar comment
@jamiepryde
Copy link
Contributor Author

jenkins test make check

@jamiepryde
Copy link
Contributor Author

jenkins test make check

@ljflores
Copy link
Member

ljflores commented Dec 3, 2024

@yuriw yuriw merged commit d70fa73 into ceph:main Dec 3, 2024
@jamiepryde jamiepryde deleted the isa-xor-handle-misaligned-buffers branch July 10, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants