diff options
author | Krishna Kumar <krkumar2@in.ibm.com> | 2006-11-24 05:32:34 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-29 18:33:09 -0500 |
commit | c78bb8442b14ee6704bdb323111ffa874d4bfdaa (patch) | |
tree | 356f77a9e174df5682fccb43c5f98cb4c9da6fe5 /drivers/infiniband | |
parent | c9edea298e52faeb0d4ae875cb712a5d69ba1966 (diff) |
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: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/addr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index a68d7c7df4ca..15ba51806ffd 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
@@ -225,17 +225,16 @@ static void process_req(void *data) | |||
225 | 225 | ||
226 | mutex_lock(&lock); | 226 | mutex_lock(&lock); |
227 | list_for_each_entry_safe(req, temp_req, &req_list, list) { | 227 | list_for_each_entry_safe(req, temp_req, &req_list, list) { |
228 | if (req->status) { | 228 | if (req->status == -ENODATA) { |
229 | src_in = (struct sockaddr_in *) &req->src_addr; | 229 | src_in = (struct sockaddr_in *) &req->src_addr; |
230 | dst_in = (struct sockaddr_in *) &req->dst_addr; | 230 | dst_in = (struct sockaddr_in *) &req->dst_addr; |
231 | req->status = addr_resolve_remote(src_in, dst_in, | 231 | req->status = addr_resolve_remote(src_in, dst_in, |
232 | req->addr); | 232 | req->addr); |
233 | if (req->status && time_after_eq(jiffies, req->timeout)) | ||
234 | req->status = -ETIMEDOUT; | ||
235 | else if (req->status == -ENODATA) | ||
236 | continue; | ||
233 | } | 237 | } |
234 | if (req->status && time_after(jiffies, req->timeout)) | ||
235 | req->status = -ETIMEDOUT; | ||
236 | else if (req->status == -ENODATA) | ||
237 | continue; | ||
238 | |||
239 | list_del(&req->list); | 238 | list_del(&req->list); |
240 | list_add_tail(&req->list, &done_list); | 239 | list_add_tail(&req->list, &done_list); |
241 | } | 240 | } |