[openib-general] [PATCH] Fix some cancellation problems in process_req().

Sean Hefty mshefty at ichips.intel.com
Tue Oct 17 10:44:47 PDT 2006


Krishna Kumar wrote:
>  	mutex_lock(&lock);
>  	list_for_each_entry_safe(req, temp_req, &req_list, list) {
> -		if (req->status) {
> +		if (req->status && req->status != -ECANCELED) {

I think we just need:

		if (req->status == -ENODATA) {

>  			src_in = (struct sockaddr_in *) &req->src_addr;
>  			dst_in = (struct sockaddr_in *) &req->dst_addr;
>  			req->status = addr_resolve_remote(src_in, dst_in,
>  							  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;
> -

The other changes look fine.  But note that if req->status == -ECANCELED and 
time_after() is true, then it seems like a toss up as to which one can be 
reported to the user.

- Sean




More information about the general mailing list