Re: svn commit: r277489 - head/sys/kern

2015-01-22 Thread Konstantin Belousov
On Wed, Jan 21, 2015 at 09:24:44PM +0300, Gleb Smirnoff wrote:
 On Wed, Jan 21, 2015 at 04:32:55PM +, Konstantin Belousov wrote:
 K Author: kib
 K Date: Wed Jan 21 16:32:54 2015
 K New Revision: 277489
 K URL: https://svnweb.freebsd.org/changeset/base/277489
 K 
 K Log:
 K   Do not assert that the new pipepair mutex is not initialized.  The
 K   backing memory contains garbage and might trigger the assertion.
 
 I have touched dozen of places in kernel where I do explicit M_ZERO on
 allocation just to satisfy later assertion in the mtx_init. Is the
 correct fix to use MTX_NEW?

I think MTX_NEW is better.  Note that this flag is just a month old, it
was added by dchagin in r275751.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r277489 - head/sys/kern

2015-01-21 Thread Gleb Smirnoff
On Wed, Jan 21, 2015 at 04:32:55PM +, Konstantin Belousov wrote:
K Author: kib
K Date: Wed Jan 21 16:32:54 2015
K New Revision: 277489
K URL: https://svnweb.freebsd.org/changeset/base/277489
K 
K Log:
K   Do not assert that the new pipepair mutex is not initialized.  The
K   backing memory contains garbage and might trigger the assertion.

I have touched dozen of places in kernel where I do explicit M_ZERO on
allocation just to satisfy later assertion in the mtx_init. Is the
correct fix to use MTX_NEW?

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r277489 - head/sys/kern

2015-01-21 Thread Konstantin Belousov
Author: kib
Date: Wed Jan 21 16:32:54 2015
New Revision: 277489
URL: https://svnweb.freebsd.org/changeset/base/277489

Log:
  Do not assert that the new pipepair mutex is not initialized.  The
  backing memory contains garbage and might trigger the assertion.
  
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:2 weeks

Modified:
  head/sys/kern/sys_pipe.c

Modified: head/sys/kern/sys_pipe.c
==
--- head/sys/kern/sys_pipe.cWed Jan 21 16:13:37 2015(r277488)
+++ head/sys/kern/sys_pipe.cWed Jan 21 16:32:54 2015(r277489)
@@ -318,7 +318,7 @@ pipe_zone_init(void *mem, int size, int 
 
pp = (struct pipepair *)mem;
 
-   mtx_init(pp-pp_mtx, pipe mutex, NULL, MTX_DEF);
+   mtx_init(pp-pp_mtx, pipe mutex, NULL, MTX_DEF | MTX_NEW);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org