2586 nfs_make_dotdot() returns sometimes EIO
Reviewed by: Garrett D'Amore <
[email protected]>
Reviewed by: Jeff Biseda <
[email protected]>
Reviewed by: Gary Mills <
[email protected]>
Reviewed by: Dan Kruchinin <
[email protected]>
Approved by: Albert Lee <
[email protected]>
--- 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) {