6867395 zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=e (#pf Page fault)
authorMark Shellenbaum <Mark.Shellenbaum@Sun.COM>
Mon, 03 Aug 2009 18:32:51 -0600
changeset 10250 b179ceb34b62
parent 10249 1e37fc71a3af
child 10251 e188a43bda3c
6867395 zpool_upgrade_007_pos testcase panic'd with BAD TRAP: type=e (#pf Page fault)
usr/src/uts/common/fs/zfs/zfs_znode.c
--- a/usr/src/uts/common/fs/zfs/zfs_znode.c	Mon Aug 03 18:24:01 2009 -0400
+++ b/usr/src/uts/common/fs/zfs/zfs_znode.c	Mon Aug 03 18:32:51 2009 -0600
@@ -200,7 +200,18 @@
 	nzp->z_sync_cnt = ozp->z_sync_cnt;
 	nzp->z_phys = ozp->z_phys;
 	nzp->z_dbuf = ozp->z_dbuf;
-	nzp->z_acl_cached = ozp->z_acl_cached;
+
+	/*
+	 * Release any cached ACL, since it *may* have
+	 * zfs_acl_node_t's that directly references an
+	 * embedded ACL in the zp_acl of the old znode_phys_t
+	 *
+	 * It will be recached the next time the ACL is needed.
+	 */
+	if (ozp->z_acl_cached) {
+		zfs_acl_free(ozp->z_acl_cached);
+		ozp->z_acl_cached = NULL;
+	}
 
 	/* Update back pointers. */
 	(void) dmu_buf_update_user(nzp->z_dbuf, ozp, nzp, &nzp->z_phys,
@@ -213,7 +224,6 @@
 	 * subsequent callback.
 	 */
 	ozp->z_dbuf = NULL;
-	ozp->z_acl_cached = NULL;
 	POINTER_INVALIDATE(&ozp->z_zfsvfs);
 }