From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 09:16:49 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 279C0106566B; Fri, 27 Jul 2012 09:16:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12B2D8FC0A; Fri, 27 Jul 2012 09:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6R9GmOI086650; Fri, 27 Jul 2012 09:16:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R9Gm23086648; Fri, 27 Jul 2012 09:16:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207270916.q6R9Gm23086648@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 27 Jul 2012 09:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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 09:16:49 -0000 Author: glebius Date: Fri Jul 27 09:16:48 2012 New Revision: 238828 URL: http://svn.freebsd.org/changeset/base/238828 Log: Add assertion for refcount overflow. Submitted by: Andrey Zonov Reviewed by: kib Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- 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__ +#include #include #ifdef _KERNEL @@ -51,6 +52,7 @@ static __inline void refcount_acquire(volatile u_int *count) { + KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); atomic_add_acq_int(count, 1); }