linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 10/10] nfsd4: clarify that renewing expired client is a bug
Date: Wed, 23 May 2012 17:40:40 -0400	[thread overview]
Message-ID: <1337809240-15770-11-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1337809240-15770-1-git-send-email-bfields@redhat.com>

From: "J. Bruce Fields" <bfields@redhat.com>

This can't happen:
	- cl_time is zeroed only by unhash_client_locked, which is only
	  ever called under both the state lock and the client lock.
	- every caller of renew_client() should have looked up a
	  (non-expired) client and then called renew_client() all
	  without dropping the state lock.
	- the only other caller of renew_client_locked() is
	  release_session_client(), which first checks under the
	  client_lock that the cl_time is nonzero.

So make it clear that this is a bug, not something we handle.  I can't
quite bring myself to make this a BUG(), though, as there are a lot of
renew_client() callers, and returning here is probably safer than a
BUG().

We'll consider making it a BUG() after some more cleanup.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4state.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 72bc277..be1fc97 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1022,7 +1022,8 @@ static inline void
 renew_client_locked(struct nfs4_client *clp)
 {
 	if (is_client_expired(clp)) {
-		dprintk("%s: client (clientid %08x/%08x) already expired\n",
+		WARN_ON(1);
+		printk("%s: client (clientid %08x/%08x) already expired\n",
 			__func__,
 			clp->cl_clientid.cl_boot,
 			clp->cl_clientid.cl_id);
-- 
1.7.9.5


      parent reply	other threads:[~2012-05-23 21:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 21:40 mainly setclientid/confirm cleanup J. Bruce Fields
2012-05-23 21:40 ` [PATCH 01/10] nfsd4: setclientid remove unnecessary terms from a logical expression J. Bruce Fields
2012-05-23 21:40 ` [PATCH 02/10] nfsd4: setclientid/confirm comment cleanup J. Bruce Fields
2012-05-23 21:40 ` [PATCH 03/10] nfsd4: merge last two setclientid cases J. Bruce Fields
2012-05-23 21:40 ` [PATCH 04/10] nfsd4: pull out common code from " J. Bruce Fields
2012-05-23 21:40 ` [PATCH 05/10] nfsd4: merge 3 setclientid cases to 2 J. Bruce Fields
2012-05-23 21:40 ` [PATCH 06/10] nfsd4: fix setclientid_confirm same_cred check J. Bruce Fields
2012-05-23 21:40 ` [PATCH 07/10] nfsd4: fix error return in non-matching-creds case J. Bruce Fields
2012-05-23 21:40 ` [PATCH 08/10] nfsd4: setclientid: remove pointless assignment J. Bruce Fields
2012-05-23 21:40 ` [PATCH 09/10] nfsd4: simpler ordering of setclientid_confirm checks J. Bruce Fields
2012-05-23 21:40 ` J. Bruce Fields [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=1337809240-15770-11-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.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;
as well as URLs for NNTP newsgroup(s).