From a22874c13e2ffaa512f4ca735fa9adad9992340c Mon Sep 17 00:00:00 2001 From: pluknet Date: Tue, 17 Jan 2012 06:23:25 +0000 Subject: [PATCH 069/175] Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing the allocated memory before calling mtx_init(9) on mtx pointing to it. Otherwize, random contents of uninitialized memory might occasionally trigger the assertion. Reported by: Pavel Polyakov Reviewed by: pjd MFC after: 1 week git-svn-id: http://svn.freebsd.org/base/head@230256 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f (cherry picked from commit fc8cd5d9e213f28b2e0ae5f8523668a13fa7cc16) Signed-off-by: Xin Li --- .../contrib/opensolaris/uts/common/fs/zfs/dnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c index b43035b..ca2b69a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c @@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, if (children_dnodes == NULL) { int i; dnode_children_t *winner; - children_dnodes = kmem_alloc(sizeof (dnode_children_t) + + children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; -- 1.7.9.4