Skip to content

nvme: retry commands on EAGAIN and EINTR (v2)#2801

Merged
igaw merged 3 commits intolinux-nvme:masterfrom
igaw:handle-eintr
May 8, 2025
Merged

nvme: retry commands on EAGAIN and EINTR (v2)#2801
igaw merged 3 commits intolinux-nvme:masterfrom
igaw:handle-eintr

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented May 8, 2025

The kernel started to return EAGAIN and EINTR. It is quiet likely that this was possible before but it happened not so often. Thus for users of nvme-cli it is a behavior change.

The first attempt was to handle this in libnvme itself. But it turns out we can't just blindly retry. It is necessary to check if the user has pressed Ctrl-C to terminate the program. Adding a signal handler inside the library is a no go. Thus add the retry logic to nvme-cli itself.

Fixes: #2760 #2781 #2775

depends on linux-nvme/libnvme#1010

igaw added 3 commits May 8, 2025 10:21
Fetch the TFR revert.

Signed-off-by: Daniel Wagner <[email protected]>
Add a helper for catching Ctrl-C from the user.

Signed-off-by: Daniel Wagner <[email protected]>
The kernel started to return EAGAIN and EINTR. It is quiet likely that
this was possible before but it happened not so often. Thus for users
of nvme-cli it is a behavior change.

The first attempt was to handle this in libnvme itself. But it turns out
we can't just blindly retry. It is necessary to check if the user has
pressed Ctrl-C to terminate the program. Adding a signal handler inside
the library is a no go. Thus add the retry logic to nvme-cli itself.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw changed the title nvme: retry commands on EAGAIN and EINTR (v2 nvme: retry commands on EAGAIN and EINTR (v2) May 8, 2025
@igaw igaw merged commit a7a2c54 into linux-nvme:master May 8, 2025
17 checks passed
@igaw igaw deleted the handle-eintr branch May 8, 2025 08:30
@igaw
Copy link
Copy Markdown
Collaborator Author

igaw commented May 8, 2025

Oh man as soon I merged it I realized that this is will not work, the return value is always -1 and errno is set. Stupid POSIX APIs.

@igaw igaw mentioned this pull request May 8, 2025
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.

Regression in "nvme connect-all -t tcp" in 2.12

1 participant