usr/src/uts/common/fs/nfs/nfs_server.c
changeset 13985 ad441dd34478
parent 13814 829c00a55a37
child 14028 bcbb822da4dd
--- a/usr/src/uts/common/fs/nfs/nfs_server.c	Tue Mar 12 19:31:47 2013 -0400
+++ b/usr/src/uts/common/fs/nfs/nfs_server.c	Thu Mar 14 17:58:04 2013 -0400
@@ -21,7 +21,6 @@
 /*
  * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
- * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
@@ -2801,8 +2800,8 @@
 			 */
 
 			/* Release the reference on the old exi value */
+			ASSERT(*exi != NULL);
 			exi_rele(*exi);
-			*exi = NULL;
 
 			if (error = nfs_check_vpexi(mc_dvp, *vpp, kcred, exi)) {
 				VN_RELE(*vpp);
@@ -2815,9 +2814,6 @@
 	if (mc_dvp)
 		VN_RELE(mc_dvp);
 
-	if (error && *exi != NULL)
-		exi_rele(*exi);
-
 	return (error);
 }
 
@@ -2963,19 +2959,16 @@
 /*
  * Get the export information for the lookup vnode, and verify its
  * useable.
- *
- * Set @exip only in success
  */
 int
 nfs_check_vpexi(vnode_t *mc_dvp, vnode_t *vp, cred_t *cr,
-    struct exportinfo **exip)
+    struct exportinfo **exi)
 {
 	int walk;
 	int error = 0;
-	struct exportinfo *exi;
-
-	exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE);
-	if (exi == NULL)
+
+	*exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE);
+	if (*exi == NULL)
 		error = EACCES;
 	else {
 		/*
@@ -2984,13 +2977,10 @@
 		 * must not terminate below the
 		 * exported directory.
 		 */
-		if (exi->exi_export.ex_flags & EX_NOSUB && walk > 0) {
+		if ((*exi)->exi_export.ex_flags & EX_NOSUB && walk > 0)
 			error = EACCES;
-			exi_rele(exi);
-		}
 	}
-	if (error == 0)
-		*exip = exi;
+
 	return (error);
 }