From owner-svn-src-head@FreeBSD.ORG Sun May 24 18:49:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25A41065675; Sun, 24 May 2009 18:49:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D05078FC14; Sun, 24 May 2009 18:49:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4OInrZ7097595; Sun, 24 May 2009 18:49:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4OInroo097594; Sun, 24 May 2009 18:49:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905241849.n4OInroo097594@svn.freebsd.org> From: Rick Macklem Date: Sun, 24 May 2009 18:49:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192693 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 May 2009 18:49:54 -0000 Author: rmacklem Date: Sun May 24 18:49:53 2009 New Revision: 192693 URL: http://svn.freebsd.org/changeset/base/192693 Log: Fix the experimental NFSv4 server so that it handles the case where a client is not allowed NFSv4 access correctly. This restriction is specified in the "V4: ..." line(s) in /etc/exports. Approved by: kib (mentor) Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun May 24 18:35:53 2009 (r192692) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun May 24 18:49:53 2009 (r192693) @@ -286,6 +286,8 @@ nfs_proc(struct nfsrv_descript *nd, u_in cacherep = RC_DROPIT; } else if (nd->nd_repstat) { cacherep = RC_REPLY; + if ((nd->nd_flag & ND_NFSV4) == 0) + panic("nfs_repstat for nfsv2,3"); } else { /* * For NFSv3, play it safe and assume that the client is @@ -313,6 +315,9 @@ nfs_proc(struct nfsrv_descript *nd, u_in else cacherep = RC_REPLY; *rpp = nfsrvd_updatecache(nd, so); + } else if (cacherep == RC_REPLY) { + /* Generate the error reply message for NFSv4 */ + nfsrvd_dorpc(nd, isdgram, td); } return (cacherep); }