changeset 13661:34a2ada0dd49

2586 nfs_make_dotdot() returns sometimes EIO Reviewed by: Garrett D'Amore <garrett.damore@gmail.com> Reviewed by: Jeff Biseda <jeff.biseda@delphix.com> Reviewed by: Gary Mills <gary_mills@fastmail.fm> Reviewed by: Dan Kruchinin <dkruchinin@acm.org> Approved by: Albert Lee <trisk@nexenta.com>
author Simon Klinkert <klinkert@webgods.de>
date Thu, 05 Apr 2012 16:16:24 +0200
parents 1905bad7dc63
children f850d57a9b6e
files usr/src/uts/common/fs/nfs/nfs4_subr.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_subr.c	Tue Apr 03 15:45:02 2012 -0500
+++ b/usr/src/uts/common/fs/nfs/nfs4_subr.c	Thu Apr 05 16:16:24 2012 +0200
@@ -2110,8 +2110,10 @@
 			goto out;
 		}
 	}
-	va.va_type = VNON;
-	pva.va_type = VNON;
+
+	pgar.n4g_va.va_type = VNON;
+	gar.n4g_va.va_type = VNON;
+
 	remap_lookup(np, rootvp, RML_ORDINARY, cr,
 	    &newfh, &gar, &newpfh, &pgar, &e);
 	if (nfs4_needs_recovery(&e, FALSE, mi->mi_vfsp)) {
@@ -2137,10 +2139,8 @@
 		goto out;
 	}
 
-	if (!e.error) {
-		va = gar.n4g_va;
-		pva = pgar.n4g_va;
-	}
+	va = gar.n4g_va;
+	pva = pgar.n4g_va;
 
 	if ((e.error != 0) ||
 	    (va.va_type != VDIR)) {
@@ -2173,6 +2173,13 @@
 		if (pnp != NULL) {
 			remap_lookup(pnp, rootvp, RML_ORDINARY, cr,
 			    &newpfh, &pgar, NULL, NULL, &e);
+			/*
+			 * This remap_lookup call modifies pgar. The following
+			 * line prevents trouble when checking the va_type of
+			 * pva later in this code.
+			 */
+			pva = pgar.n4g_va;
+
 			if (nfs4_needs_recovery(&e, FALSE,
 			    mi->mi_vfsp)) {
 				if (need_start_op) {