From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>,
linux-nfs@vger.kernel.org, kinglongmee@gmail.com
Subject: Re: [PATCH] nfsd4: handle failure to find backchannel
Date: Sat, 12 Jul 2014 22:02:17 +0800 [thread overview]
Message-ID: <53C13FE9.3080503@gmail.com> (raw)
In-Reply-To: <20140711211609.GA13656@fieldses.org>
On 7/12/2014 05:16, J. Bruce Fields wrote:
> The local variable "ses" will be left NULL here in the case we fail to
> find a connection. Spotted by a coverity scan.
>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
>
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index 2c73cae9899d..fe22cd5c42d3 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -1001,14 +1001,18 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb)
> }
> spin_unlock(&clp->cl_lock);
>
> + if (!c)
> + goto out_no_connection;
Setting err to -EINVAL maybe better.
Otherwise, nfsd4_mark_cb_down will be called with err == 0.
> err = setup_callback_client(clp, &conn, ses);
setup_callback_client also return -EINVAL when ses == NULL with conn.cb_xprt == NULL.
thanks,
Kinglong Mee
> - if (err) {
> - nfsd4_mark_cb_down(clp, err);
> - return;
> - }
> + if (err)
> + goto out_no_connection;
> /* Yay, the callback channel's back! Restart any callbacks: */
> list_for_each_entry(cb, &clp->cl_callbacks, cb_per_client)
> run_nfsd4_cb(cb);
> + return;
> +out_no_connection:
> + nfsd4_mark_cb_down(clp, err);
> + return;
> }
>
> static void nfsd4_do_callback_rpc(struct work_struct *w)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-07-12 14:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 21:16 [PATCH] nfsd4: handle failure to find backchannel J. Bruce Fields
2014-07-12 14:02 ` Kinglong Mee [this message]
2014-07-16 22:05 ` J. Bruce Fields
2014-07-17 13:24 ` Kinglong Mee
2014-07-17 15:13 ` J. Bruce Fields
2014-07-18 0:01 ` 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=53C13FE9.3080503@gmail.com \
--to=kinglongmee@gmail.com \
--cc=bfields@fieldses.org \
--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 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.