All of lore.kernel.org
 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 2/9] nfsd4: STALE_STATEID cleanup
Date: Thu, 21 Mar 2013 10:56:13 -0400	[thread overview]
Message-ID: <1363877780-28825-3-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1363877780-28825-1-git-send-email-bfields@redhat.com>

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

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

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c5af45d..cfd4430 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3278,16 +3278,6 @@ static inline __be32 nfs4_check_fh(struct svc_fh *fhp, struct nfs4_ol_stateid *s
 	return nfs_ok;
 }
 
-static int
-STALE_STATEID(stateid_t *stateid, struct nfsd_net *nn)
-{
-	if (stateid->si_opaque.so_clid.cl_boot == nn->boot_time)
-		return 0;
-	dprintk("NFSD: stale stateid " STATEID_FMT "!\n",
-		STATEID_VAL(stateid));
-	return 1;
-}
-
 static inline int
 access_permit_read(struct nfs4_ol_stateid *stp)
 {
@@ -3418,19 +3408,20 @@ static __be32 nfsd4_lookup_stateid(stateid_t *stateid, unsigned char typemask,
 				   struct nfsd_net *nn)
 {
 	struct nfs4_client *cl;
+	__be32 status;
 
 	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
 		return nfserr_bad_stateid;
-	if (STALE_STATEID(stateid, nn))
+	status = lookup_clientid(&stateid->si_opaque.so_clid, sessions,
+							nn, &cl);
+	if (status == nfserr_stale_clientid)
 		return nfserr_stale_stateid;
-	cl = find_confirmed_client(&stateid->si_opaque.so_clid, sessions, nn);
-	if (!cl)
-		return nfserr_expired;
+	if (status)
+		return status;
 	*s = find_stateid_by_type(cl, stateid, typemask);
 	if (!*s)
 		return nfserr_bad_stateid;
 	return nfs_ok;
-
 }
 
 /*
-- 
1.7.9.5


  parent reply	other threads:[~2013-03-21 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 14:56 fix some nfsd4.1 state races for 3.10 J. Bruce Fields
2013-03-21 14:56 ` [PATCH 1/9] nfsd4: warn on odd create_session state J. Bruce Fields
2013-03-21 14:56 ` J. Bruce Fields [this message]
2013-03-21 14:56 ` [PATCH 3/9] nfsd4: remove some dprintk's J. Bruce Fields
2013-03-21 14:56 ` [PATCH 4/9] nfsd4: destroy_clientid simplification J. Bruce Fields
2013-03-21 14:56 ` [PATCH 5/9] nfsd4: clientid lookup cleanup J. Bruce Fields
2013-03-21 14:56 ` [PATCH 6/9] nfsd4: fix destroy_session race J. Bruce Fields
2013-03-21 14:56 ` [PATCH 7/9] nfsd4: simplify bind_conn_to_session locking J. Bruce Fields
2013-03-21 14:56 ` [PATCH 8/9] nfsd4: don't destroy in-use clients J. Bruce Fields
2013-03-21 14:56 ` [PATCH 9/9] nfsd4: don't destroy in-use session J. Bruce Fields

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=1363877780-28825-3-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 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.