Date: Tue, 17 Jan 2012 06:23:26 +0000 (UTC) From: Sergey Kandaurov <pluknet@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r230256 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201201170623.q0H6NQIF070849@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pluknet Date: Tue Jan 17 06:23:25 2012 New Revision: 230256 URL: http://svn.freebsd.org/changeset/base/230256 Log: 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 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 04:45:11 2012 (r230255) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 17 06:23:25 2012 (r230256) @@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t o 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];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201170623.q0H6NQIF070849>