changeset 13826:23fd30d0ae03

3158 nfs: Server should return NFS4_OK with zero length COMPOUND request Reviewed by: Eric Schrock <eric.schrock@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Daniil Lunev <d.lunev.mail@gmail.com>
date Tue, 04 Sep 2012 21:55:34 -0500
parents 63b4afd261aa
children 9eaeead74954
files usr/src/uts/common/fs/nfs/nfs4_srv.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_srv.c	Thu Aug 30 15:52:25 2012 -0500
+++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c	Tue Sep 04 21:55:34 2012 -0500
@@ -5804,13 +5804,12 @@
 
 	cs.statusp = &resp->status;
 	cs.req = req;
+	resp->array = NULL;
+	resp->array_len = 0;
 
 	resp->status = utf8_name_verify(&(resp->tag));
-	if (resp->status != NFS4_OK) {
-		resp->array_len = 0;
-		resp->array = NULL;
+	if (resp->status != NFS4_OK)
 		return;
-	}
 
 	/*
 	 * XXX for now, minorversion should be zero
@@ -5818,14 +5817,17 @@
 	if (args->minorversion != NFS4_MINORVERSION) {
 		DTRACE_NFSV4_2(compound__start, struct compound_state *,
 		    &cs, COMPOUND4args *, args);
-		resp->array_len = 0;
-		resp->array = NULL;
 		resp->status = NFS4ERR_MINOR_VERS_MISMATCH;
 		DTRACE_NFSV4_2(compound__done, struct compound_state *,
 		    &cs, COMPOUND4res *, resp);
 		return;
 	}
 
+	if (args->array_len == 0) {
+		resp->status = NFS4_OK;
+		return;
+	}
+
 	ASSERT(exi == NULL);
 	ASSERT(cr == NULL);