From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2] Do not enter setup_callback_client when finding backchannel failed
Date: Tue, 03 Dec 2013 11:40:53 +0800 [thread overview]
Message-ID: <529D52C5.6050404@gmail.com> (raw)
In-Reply-To: <20131202145917.GF1960@fieldses.org>
Finding backchannel failed, nfsd should not enter setup_callback_client.
v2. drop ses checking in setup_callback_client and make code more clearer.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
fs/nfsd/nfs4callback.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 7f05cd1..44d33ce 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -975,11 +975,15 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb)
clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags);
memcpy(&conn, &cb->cb_clp->cl_cb_conn, sizeof(struct nfs4_cb_conn));
c = __nfsd4_find_backchannel(clp);
- if (c) {
- svc_xprt_get(c->cn_xprt);
- conn.cb_xprt = c->cn_xprt;
- ses = c->cn_session;
+ if (!c) {
+ spin_unlock(&clp->cl_lock);
+ nfsd4_mark_cb_down(clp, -ENOTCONN);
+ return;
}
+
+ svc_xprt_get(c->cn_xprt);
+ conn.cb_xprt = c->cn_xprt;
+ ses = c->cn_session;
spin_unlock(&clp->cl_lock);
err = setup_callback_client(clp, &conn, ses);
--
1.8.4.2
prev parent reply other threads:[~2013-12-03 3:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 10:29 [PATCH] Do not enter setup_callback_client when finding backchannel failed Kinglong Mee
2013-12-02 14:59 ` J. Bruce Fields
2013-12-03 2:46 ` Kinglong Mee
2013-12-04 17:10 ` J. Bruce Fields
2013-12-05 2:09 ` Kinglong Mee
2013-12-06 18:00 ` J. Bruce Fields
2013-12-09 1:17 ` Kinglong Mee
2013-12-03 3:40 ` Kinglong Mee [this message]
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=529D52C5.6050404@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).