--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c.orig
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
@@ -2557,7 +2557,8 @@
 	}
 
 	for (i = 0; i < TXG_SIZE; i++) {
-		if (list_link_active(&dn->dn_dirty_link[i])) {
+		if (list_link_active(&dn->dn_dirty_link[i]) ||
+		    !list_is_empty(&dn->dn_dirty_records[i])) {
 			break;
 		}
 	}
