From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:12:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A1F1065672; Fri, 27 Jul 2012 11:12:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 70A5E8FC08; Fri, 27 Jul 2012 11:12:47 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6RBCo0w074916; Fri, 27 Jul 2012 14:12:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6RBCblK005524; Fri, 27 Jul 2012 14:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6RBCbCp005523; Fri, 27 Jul 2012 14:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Jul 2012 14:12:37 +0300 From: Konstantin Belousov To: Gleb Smirnoff Message-ID: <20120727111237.GC2676@deviant.kiev.zoral.com.ua> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yx93Kc6BzsIU1RZq" Content-Disposition: inline In-Reply-To: <201207270916.q6R9Gm23086648@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:12:48 -0000 --yx93Kc6BzsIU1RZq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jul 27 09:16:48 2012 > New Revision: 238828 > URL: http://svn.freebsd.org/changeset/base/238828 >=20 > Log: > Add assertion for refcount overflow. > =20 > Submitted by: Andrey Zonov > Reviewed by: kib It was discussed rather then reviewed. I suggest that the assert may be expressed as a check after the increment, which verifies that counter is !=3D 0. This allows to avoid namespace pollution due to limits.h. >=20 > Modified: > head/sys/sys/refcount.h >=20 > Modified: head/sys/sys/refcount.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/refcount.h Fri Jul 27 08:28:44 2012 (r238827) > +++ head/sys/sys/refcount.h Fri Jul 27 09:16:48 2012 (r238828) > @@ -32,6 +32,7 @@ > #ifndef __SYS_REFCOUNT_H__ > #define __SYS_REFCOUNT_H__ > =20 > +#include > #include > =20 > #ifdef _KERNEL > @@ -51,6 +52,7 @@ static __inline void > refcount_acquire(volatile u_int *count) > { > =20 > + KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); > atomic_add_acq_int(count, 1);=09 > } > =20 --yx93Kc6BzsIU1RZq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlASd6UACgkQC3+MBN1Mb4j1ywCg4F5Qe2TLuK3WR4fhxIcMSNF1 eW8AnimtZVUxhTV2VQueX0rto3E5D8aI =fOjQ -----END PGP SIGNATURE----- --yx93Kc6BzsIU1RZq--