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

Fix tcmulib get next command on aarch64 #693

Merged

Conversation

geordieintheshellcode
Copy link

Please see See #688 for the problem, repro and rationale behind the fix.

Copy link
Collaborator

@lxbsz lxbsz left a comment

Choose a reason for hiding this comment

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

This LGTM.
Could you add the comments in the commit and add the singed-off-by at the same time ?
Thanks

@geordieintheshellcode
Copy link
Author

@lxbsz thanks. I don't quite follow what you mean when you say:

Could you add the comments in the commit and add the singed-off-by at the same time ?
Thanks

@lxbsz
Copy link
Collaborator

lxbsz commented Feb 19, 2023

@lxbsz thanks. I don't quite follow what you mean when you say:

Could you add the comments in the commit and add the singed-off-by at the same time ?
Thanks

Please see the following commit's format:

commit 245914c1446dddf07d5b58b0a7b2060b50fde4d7
Author: Xiubo Li <[email protected]>
Date:   Tue Sep 14 16:25:23 2021 +0800

    rbd: switch strtok to strtok_r
    
    The strtok is not thread safe, there could be several threads will
    call the tcmu_rbd_open() at the same time.
    
    And sometimes we can randomly hit some errors like:
    
    [ERROR] tcmu_rbd_open:877 datapool/block0: Could not get image name
    
    But when try it again it will succeed.
    
    Signed-off-by: Xiubo Li <[email protected]>

@geordieintheshellcode geordieintheshellcode force-pushed the tcmulib-get-next-command-broken-aarch64 branch from a022d7b to c949cce Compare February 20, 2023 16:09
geordieintheshellcode pushed a commit to ondat/tcmu-runner that referenced this pull request Feb 20, 2023
Use the appropriate atomic load instruction to ensure we synchronize
the read of the command ring head index with any previous stores. Not
doing this causes command ring corruption on aarch64:

[Tue Oct  4 15:45:50 2022] cmd_id 0 not found, ring is broken
[Tue Oct  4 15:45:50 2022] ring broken, not handling completions

See issue open-iscsi#688. PR open-iscsi#693.

Signed-off-by: Xiubo Li <[email protected]>
@geordieintheshellcode geordieintheshellcode force-pushed the tcmulib-get-next-command-broken-aarch64 branch from c949cce to 2e5e831 Compare February 20, 2023 16:11
@geordieintheshellcode
Copy link
Author

I've done that now @lxbsz. Thanks

@lxbsz
Copy link
Collaborator

lxbsz commented Feb 21, 2023

Use the appropriate atomic load instruction to ensure we synchronize
the read of the command ring head index with any previous stores. Not
doing this causes command ring corruption on aarch64:

[Tue Oct 4 15:45:50 2022] cmd_id 0 not found, ring is broken
[Tue Oct 4 15:45:50 2022] ring broken, not handling completions

See issue open-iscsi#688. PR open-iscsi#693.

Signed-off-by: Xiubo Li [email protected]

NO, this is incorrect.

It should be something likes:

libtcmu: fix tcmulib to get next command on aarch64

Use the appropriate atomic load instruction to ensure we synchronize
the read of the command ring head index with any previous stores. Not
doing this causes command ring corruption on aarch64:

[Tue Oct  4 15:45:50 2022] cmd_id 0 not found, ring is broken
[Tue Oct  4 15:45:50 2022] ring broken, not handling completions

Signed-off-by: ${Your Full Name} <${Your Mail}>

Use the appropriate atomic load instruction to ensure we synchronize
the read of the command ring head index with any previous stores. Not
doing this causes command ring corruption on aarch64:

[Tue Oct  4 15:45:50 2022] cmd_id 0 not found, ring is broken
[Tue Oct  4 15:45:50 2022] ring broken, not handling completions

Signed-off-by: Alex Reid <[email protected]>
@geordieintheshellcode geordieintheshellcode force-pushed the tcmulib-get-next-command-broken-aarch64 branch from 2e5e831 to b3afc3a Compare February 24, 2023 09:44
@geordieintheshellcode
Copy link
Author

Done! Turns git commit -s is your friend 😄

@lxbsz lxbsz merged commit 1bdb239 into open-iscsi:main May 26, 2023
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.

2 participants