All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: shaobingqing <shaobingqing@bwstor.com.cn>,
	trond.myklebust@primarydata.com, bfields@redhat.com,
	davem@davemloft.net
Cc: linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: Allow one callback request to be received from two sk_buff
Date: Mon, 20 Jan 2014 18:27:19 +0400	[thread overview]
Message-ID: <52DD3247.6090108@cogentembedded.com> (raw)
In-Reply-To: <1390201154-20815-1-git-send-email-shaobingqing@bwstor.com.cn>

Hello.

On 20-01-2014 10:59, shaobingqing wrote:

> In current code, there only one struct rpc_rqst is prealloced. If one
> callback request is received from two sk_buff, the xprt_alloc_bc_request
> would be execute two times with the same transport->xid. The first time
> xprt_alloc_bc_request will alloc one struct rpc_rqst and the TCP_RCV_COPY_DATA
> bit of transport->tcp_flags will not be cleared. The second time
> xprt_alloc_bc_request could not alloc struct rpc_rqst any more and NULL
> pointer will be returned, then xprt_force_disconnect occur. I think one
> callback request can be allowed to be received from two sk_buff.

> Signed-off-by: shaobingqing <shaobingqing@bwstor.com.cn>
> ---
>   net/sunrpc/xprtsock.c |   11 +++++++++--
>   1 files changed, 9 insertions(+), 2 deletions(-)

> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index ee03d35..606950d 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
[...]
> @@ -1297,7 +1303,8 @@ static inline int xs_tcp_read_callback(struct rpc_xprt *xprt,
>   		list_add(&req->rq_bc_list, &bc_serv->sv_cb_list);
>   		spin_unlock(&bc_serv->sv_cb_lock);
>   		wake_up(&bc_serv->sv_cb_waitq);
> -	}
> +	} else
> +		req_partial = req;

    {} is needed in the *else* branch since it's already used in another 
branch of *if* -- see Documentation/CodingStyle.

WBR, Sergei


  reply	other threads:[~2014-01-20 14:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20  6:59 [PATCH] SUNRPC: Allow one callback request to be received from two sk_buff shaobingqing
2014-01-20 14:27 ` Sergei Shtylyov [this message]
2014-01-20 23:17 ` Trond Myklebust
2014-01-21 10:08   ` shaobingqing
2014-01-21 10:08     ` shaobingqing
2014-01-21 15:35     ` Trond Myklebust
2014-01-21 15:35       ` Trond Myklebust
2014-01-22 23:52       ` J. Bruce Fields
2014-01-22 23:52         ` J. Bruce Fields
2014-01-23  1:42         ` shaobingqing
2014-01-23  2:23       ` shaobingqing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52DD3247.6090108@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=bfields@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shaobingqing@bwstor.com.cn \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.