logging: retry ioctl on EINTR return value#2775
logging: retry ioctl on EINTR return value#2775igaw wants to merge 1 commit intolinux-nvme:masterfrom
Conversation
Recent changes in the nvme-tcp transport started to return EINTR due to a signal while reading from a socket. The transport could retry the operation but so far this hasn't been implemented. Thus we retry in userpace the connect call when EINTR is returned. Signed-off-by: Daniel Wagner <[email protected]>
|
Just confirmed below the
int nvme_execute_rq(struct request *rq, bool at_head)
{
blk_status_t status;
status = blk_execute_rq(rq, at_head);
if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
return -EINTR;
...
static enum blk_eh_timer_return nvme_timeout(struct request *req)
{
...
switch (nvme_ctrl_state(&dev->ctrl)) {
case NVME_CTRL_CONNECTING:
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
fallthrough;
case NVME_CTRL_DELETING:
dev_warn_ratelimited(dev->ctrl.device,
"I/O tag %d (%04x) QID %d timeout, disable controller\n",
req->tag, nvme_cid(req), nvmeq->qid);
nvme_req(req)->flags |= NVME_REQ_CANCELLED;Let me ask below questions since I am not sure the PR changes correct (but seems for some cases there are some risks and not good).
|
|
I share your concerns. And after reading a bit more on it, I think the simple approach with retrying on The kernel returns https://pubs.opengroup.org/onlinepubs/009696799/functions/xsh_chap02_03.html that means we should be able to retry. I don't want to start handling signal in the library if possible. One thing we could do is to limit the retry loop to avoid live locks. Anyway, needs a bit more thought. |
Recent changes in the nvme-tcp transport started to return EINTR due to a signal while reading from a socket. The transport could retry the operation but so far this hasn't been implemented. Thus we retry in userpace the connect call when EINTR is returned.
Fixes: ##2760