From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: [PATCH] nfsd41: Deny new lock before RECLAIM_COMPLETE done
Date: Wed, 27 Apr 2011 09:12:00 +0800 [thread overview]
Message-ID: <4DB76D60.3010802@cn.fujitsu.com> (raw)
Before nfs41 client's RECLAIM_COMPLETE done, nfs server should
deny it's new lock.
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
fs/nfsd/nfs4state.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4b36ec3..43cda94 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3803,6 +3803,15 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
*/
struct nfs4_stateid *open_stp = NULL;
+ /*
+ * RFC5661 18.51.3
+ * Before RECLAIM_COMPLETE done, return NFS4ERR_GRACE
+ */
+ status = nfserr_grace;
+ if (nfsd4_has_session(cstate) &&
+ !cstate->session->se_client->cl_firststate)
+ goto out;
+
status = nfserr_stale_clientid;
if (!nfsd4_has_session(cstate) &&
STALE_CLIENTID(&lock->lk_new_clientid))
--
1.7.4.1
next reply other threads:[~2011-04-27 1:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 1:12 Mi Jinlong [this message]
2011-04-27 13:54 ` [PATCH] nfsd41: Deny new lock before RECLAIM_COMPLETE done J. Bruce Fields
2011-05-10 9:17 ` Mi Jinlong
2011-05-10 9:23 ` Mi Jinlong
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=4DB76D60.3010802@cn.fujitsu.com \
--to=mijinlong@cn.fujitsu.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).