changeset 3700:3a7e0afcf1b4

6523936 BAD TRAP: type=8 (#df Double fault) rp=fec266f8 addr=0 6526874 ARC is using ints instead of uint64s in some places 6527134 'zpool status -v' can report duplicate entries duplicate entries
author ek110237
date Thu, 22 Feb 2007 18:00:20 -0800
parents 73d0ad1094f7
children fec29e0d1d48
files usr/src/lib/libzfs/common/libzfs_pool.c usr/src/uts/common/fs/zfs/arc.c usr/src/uts/common/fs/zfs/sys/dbuf.h usr/src/uts/common/fs/zfs/sys/spa.h
diffstat 4 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libzfs/common/libzfs_pool.c	Thu Feb 22 17:44:28 2007 -0800
+++ b/usr/src/lib/libzfs/common/libzfs_pool.c	Thu Feb 22 18:00:20 2007 -0800
@@ -1624,8 +1624,9 @@
 	for (i = 0; i < count; i++) {
 		nvlist_t *nv;
 
-		if (i > 0 && memcmp(&zb[i - 1], &zb[i],
-		    sizeof (zbookmark_t)) == 0)
+		/* ignoring zb_blkid and zb_level for now */
+		if (i > 0 && zb[i-1].zb_objset == zb[i].zb_objset &&
+		    zb[i-1].zb_object == zb[i].zb_object)
 			continue;
 
 		if (nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) != 0)
--- a/usr/src/uts/common/fs/zfs/arc.c	Thu Feb 22 17:44:28 2007 -0800
+++ b/usr/src/uts/common/fs/zfs/arc.c	Thu Feb 22 18:00:20 2007 -0800
@@ -723,7 +723,7 @@
 
 	if ((refcount_add(&ab->b_refcnt, tag) == 1) &&
 	    (ab->b_state != arc_anon)) {
-		int delta = ab->b_size * ab->b_datacnt;
+		uint64_t delta = ab->b_size * ab->b_datacnt;
 
 		ASSERT(!MUTEX_HELD(&ab->b_state->arcs_mtx));
 		mutex_enter(&ab->b_state->arcs_mtx);
@@ -775,8 +775,8 @@
 arc_change_state(arc_state_t *new_state, arc_buf_hdr_t *ab, kmutex_t *hash_lock)
 {
 	arc_state_t *old_state = ab->b_state;
-	int refcnt = refcount_count(&ab->b_refcnt);
-	int from_delta, to_delta;
+	int64_t refcnt = refcount_count(&ab->b_refcnt);
+	uint64_t from_delta, to_delta;
 
 	ASSERT(MUTEX_HELD(hash_lock));
 	ASSERT(new_state != old_state);
@@ -1219,7 +1219,7 @@
 	arc_buf_hdr_t *ab, *ab_prev;
 	kmutex_t *hash_lock;
 	uint64_t bytes_deleted = 0;
-	uint_t bufs_skipped = 0;
+	uint64_t bufs_skipped = 0;
 
 	ASSERT(GHOST_STATE(state));
 top:
--- a/usr/src/uts/common/fs/zfs/sys/dbuf.h	Thu Feb 22 17:44:28 2007 -0800
+++ b/usr/src/uts/common/fs/zfs/sys/dbuf.h	Thu Feb 22 18:00:20 2007 -0800
@@ -309,10 +309,11 @@
 
 #define	dprintf_dbuf_bp(db, bp, fmt, ...) do {			\
 	if (zfs_flags & ZFS_DEBUG_DPRINTF) {			\
-	char __blkbuf[BP_SPRINTF_LEN];				\
+	char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_SLEEP);	\
 	sprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, bp);		\
 	dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf);	\
-	} \
+	kmem_free(__blkbuf, BP_SPRINTF_LEN);			\
+	} 							\
 _NOTE(CONSTCOND) } while (0)
 
 #define	DBUF_VERIFY(db)	dbuf_verify(db)
--- a/usr/src/uts/common/fs/zfs/sys/spa.h	Thu Feb 22 17:44:28 2007 -0800
+++ b/usr/src/uts/common/fs/zfs/sys/spa.h	Thu Feb 22 18:00:20 2007 -0800
@@ -464,11 +464,12 @@
 extern void spa_fini(void);
 
 #ifdef ZFS_DEBUG
-#define	dprintf_bp(bp, fmt, ...) do {			\
-	if (zfs_flags & ZFS_DEBUG_DPRINTF) { 		\
-	char __blkbuf[BP_SPRINTF_LEN];			\
-	sprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, (bp));	\
-	dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf);	\
+#define	dprintf_bp(bp, fmt, ...) do {				\
+	if (zfs_flags & ZFS_DEBUG_DPRINTF) { 			\
+	char *__blkbuf = kmem_alloc(BP_SPRINTF_LEN, KM_SLEEP);	\
+	sprintf_blkptr(__blkbuf, BP_SPRINTF_LEN, (bp));		\
+	dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf);		\
+	kmem_free(__blkbuf, BP_SPRINTF_LEN);			\
 	} \
 _NOTE(CONSTCOND) } while (0)
 #else