diff options
author | pluknet <pluknet@FreeBSD.org> | 2012-01-17 06:23:25 +0000 |
---|---|---|
committer | pluknet <pluknet@FreeBSD.org> | 2012-01-17 06:23:25 +0000 |
commit | 8c28719b6da390c06d440d3c6850d22a7237c981 (patch) | |
tree | d6dc9778950f260b97d8950041c9cc56e3af0f86 | |
parent | 1a0c72b3fe6333e317d2211ed9447ed6f8130f7f (diff) | |
download | FreeBSD-src-8c28719b6da390c06d440d3c6850d22a7237c981.zip FreeBSD-src-8c28719b6da390c06d440d3c6850d22a7237c981.tar.gz |
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 <bsd kobyla org>
Reviewed by: pjd
MFC after: 1 week
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]; |