linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND
@ 2011-06-16 15:39 Benny Halevy
  2011-06-20 19:31 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Benny Halevy @ 2011-06-16 15:39 UTC (permalink / raw)
  To:  J. Bruce Fields; +Cc: linux-nfs, Benny Halevy

>From RFC5661, section 18.50:
   DESTROY_CLIENTID MAY be preceded with a SEQUENCE operation as long as
   the client ID derived from the session ID of SEQUENCE is not the same
   as the client ID to be destroyed.  If the client IDs are the same,
   then the server MUST return NFS4ERR_CLIENTID_BUSY.

(that's not implemented yet)

   If DESTROY_CLIENTID is not prefixed by SEQUENCE, it MUST be the only
   operation in the COMPOUND request (otherwise, the server MUST return
   NFS4ERR_NOT_ONLY_OP).

Signed-off-by: Benny Halevy <benny@tonian.com>
---
 fs/nfsd/nfs4proc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 730b6e7..02adcc3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1773,6 +1773,11 @@ static struct nfsd4_operation nfsd4_ops[] = {
 		.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
 		.op_name = "OP_SEQUENCE",
 	},
+	[OP_DESTROY_CLIENTID] = {
+		.op_func = NULL,
+		.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
+		.op_name = "OP_DESTROY_CLIENTID",
+	},
 	[OP_RECLAIM_COMPLETE] = {
 		.op_func = (nfsd4op_func)nfsd4_reclaim_complete,
 		.op_flags = ALLOWED_WITHOUT_FH,
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND
  2011-06-16 15:39 [PATCH] NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND Benny Halevy
@ 2011-06-20 19:31 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2011-06-20 19:31 UTC (permalink / raw)
  To: Benny Halevy; +Cc:  J. Bruce Fields, linux-nfs

On Thu, Jun 16, 2011 at 11:39:10AM -0400, Benny Halevy wrote:
> >From RFC5661, section 18.50:
>    DESTROY_CLIENTID MAY be preceded with a SEQUENCE operation as long as
>    the client ID derived from the session ID of SEQUENCE is not the same
>    as the client ID to be destroyed.  If the client IDs are the same,
>    then the server MUST return NFS4ERR_CLIENTID_BUSY.
> 
> (that's not implemented yet)
> 
>    If DESTROY_CLIENTID is not prefixed by SEQUENCE, it MUST be the only
>    operation in the COMPOUND request (otherwise, the server MUST return
>    NFS4ERR_NOT_ONLY_OP).

Applying for 3.1, with a note that:

	"This fixes the error return; before, we returned
	NFS4ERR_OP_NOT_IN_SESSION; after this patch, we return
	NFS4ERR_NOTSUPP."

(I think that's what you saw?)

--b.

> 
> Signed-off-by: Benny Halevy <benny@tonian.com>
> ---
>  fs/nfsd/nfs4proc.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 730b6e7..02adcc3 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1773,6 +1773,11 @@ static struct nfsd4_operation nfsd4_ops[] = {
>  		.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
>  		.op_name = "OP_SEQUENCE",
>  	},
> +	[OP_DESTROY_CLIENTID] = {
> +		.op_func = NULL,
> +		.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
> +		.op_name = "OP_DESTROY_CLIENTID",
> +	},
>  	[OP_RECLAIM_COMPLETE] = {
>  		.op_func = (nfsd4op_func)nfsd4_reclaim_complete,
>  		.op_flags = ALLOWED_WITHOUT_FH,
> -- 
> 1.7.4.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-20 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-16 15:39 [PATCH] NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND Benny Halevy
2011-06-20 19:31 ` J. Bruce Fields

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).