提交 c78bb844 编写于 作者: K Krishna Kumar 提交者: Roland Dreier

RDMA/addr: Fix some cancellation problems in process_req()

Fix following problems in process_req() relating to cancellation:

- Function is wrongly doing another addr_remote() when cancelled,
  which is not required.
- Make failure reporting immediate by using time_after_eq().
- On cancellation, -ETIMEDOUT was returned to the callback routine
  instead of the more appropriate -ECANCELLED (users getting notified
  may want to print/return this status, eg ucma_event_handler).
Signed-off-by: NKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 c9edea29
...@@ -225,17 +225,16 @@ static void process_req(void *data) ...@@ -225,17 +225,16 @@ static void process_req(void *data)
mutex_lock(&lock); mutex_lock(&lock);
list_for_each_entry_safe(req, temp_req, &req_list, list) { list_for_each_entry_safe(req, temp_req, &req_list, list) {
if (req->status) { if (req->status == -ENODATA) {
src_in = (struct sockaddr_in *) &req->src_addr; src_in = (struct sockaddr_in *) &req->src_addr;
dst_in = (struct sockaddr_in *) &req->dst_addr; dst_in = (struct sockaddr_in *) &req->dst_addr;
req->status = addr_resolve_remote(src_in, dst_in, req->status = addr_resolve_remote(src_in, dst_in,
req->addr); req->addr);
if (req->status && time_after_eq(jiffies, req->timeout))
req->status = -ETIMEDOUT;
else if (req->status == -ENODATA)
continue;
} }
if (req->status && time_after(jiffies, req->timeout))
req->status = -ETIMEDOUT;
else if (req->status == -ENODATA)
continue;
list_del(&req->list); list_del(&req->list);
list_add_tail(&req->list, &done_list); list_add_tail(&req->list, &done_list);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册