From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: Dr Fields James Bruce <bfields@fieldses.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] SUNRPC: Clear xpt_bc_xprt if xs_setup_bc_tcp failed
Date: Tue, 7 Jan 2014 00:01:30 -0500 [thread overview]
Message-ID: <11FBA3CF-C026-42F8-943E-326B11A55929@primarydata.com> (raw)
In-Reply-To: <52CB8564.6040002@gmail.com>
On Jan 6, 2014, at 23:41, Kinglong Mee <kinglongmee@gmail.com> wrote:
> If try_module_get failed, xpt_bc_xprt should be set to NULL,
> because xprt will be free.
>
> Don't needed using xprt_put to free xprt, because it is always new.
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
> net/sunrpc/xprtsock.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
> index 4fcdf74..5ed124f 100644
> --- a/net/sunrpc/xprtsock.c
> +++ b/net/sunrpc/xprtsock.c
> @@ -2986,10 +2986,10 @@ static struct rpc_xprt *xs_setup_bc_tcp(struct xprt_create *args)
> */
> xprt_set_connected(xprt);
>
> -
> if (try_module_get(THIS_MODULE))
> return xprt;
> - xprt_put(xprt);
> +
> + args->bc_xprt->xpt_bc_xprt = NULL;
> ret = ERR_PTR(-EINVAL);
> out_err:
> xs_xprt_free(xprt);
Just move the 'args->bc_xprt->xpt_bc_xprt = xprt’ line into the caller (see earlier discussion about xs_setup_bc_tcp()). Quite frankly, I don’t see why the client code should be modifying this variable in the first place. An svc_xprt is a server construct.
Trond
next prev parent reply other threads:[~2014-01-07 5:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 4:41 [PATCH] SUNRPC: Clear xpt_bc_xprt if xs_setup_bc_tcp failed Kinglong Mee
2014-01-07 5:01 ` Trond Myklebust [this message]
2014-01-07 5:21 ` Kinglong Mee
2014-01-07 7:26 ` Kinglong Mee
2014-01-09 16:34 ` Dr Fields James Bruce
2014-01-10 2:43 ` Kinglong Mee
2014-01-10 3:22 ` Kinglong Mee
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=11FBA3CF-C026-42F8-943E-326B11A55929@primarydata.com \
--to=trond.myklebust@primarydata.com \
--cc=bfields@fieldses.org \
--cc=kinglongmee@gmail.com \
--cc=linux-nfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox