svn commit: r230497 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Sergey Kandaurov pluknet at FreeBSD.org
Tue Jan 24 10:28:20 UTC 2012


Author: pluknet
Date: Tue Jan 24 10:28:19 2012
New Revision: 230497
URL: http://svn.freebsd.org/changeset/base/230497

Log:
  MFC r230256:
   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

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c	Tue Jan 24 09:51:42 2012	(r230496)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c	Tue Jan 24 10:28:19 2012	(r230497)
@@ -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];


More information about the svn-src-all mailing list