From owner-svn-src-head@FreeBSD.ORG Sat May 23 18:35:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928AF106566C; Sat, 23 May 2009 18:35:26 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 630AA8FC18; Sat, 23 May 2009 18:35:26 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n4NIZOAI082976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 23 May 2009 11:35:25 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4A1841EC.9030303@freebsd.org> Date: Sat, 23 May 2009 11:35:24 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090411) MIME-Version: 1.0 To: Bruce Evans References: <200905221810.n4MIAe4J014419@svn.freebsd.org> <20090522184846.GA34437@FreeBSD.org> <4A16F40B.4020404@freebsd.org> <20090523210556.Y826@delplex.bde.org> In-Reply-To: <20090523210556.Y826@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192591 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2009 18:35:27 -0000 Bruce Evans wrote: > On Fri, 22 May 2009, Sam Leffler wrote: > >> Alexey Dokuchaev wrote: >>> On Fri, May 22, 2009 at 06:10:40PM +0000, Rick Macklem wrote: >>>> ... >>>> Log: >>>> Modified the printf message of r192590 to remove the >>>> possible DOS attack, as suggested by Sam. >>>> - printf("out of clientids, possible DOS attack\n"); >>>> + printf("out of clientids\n"); >>>> >>> >>> Previously, panic() message referred "nfs4", now it does not, making it >>> rather cryptic without grepping through the source code. >>> . >> I requested the printf identify the call site; e.g. >> >> printf("%s: out of clientids\n", __func__); > > That is equally cryptic _with_ grepping through the source code, and > much uglier. __func__ should only be used when the function name is > not a literal constant (mainly in macros). The new nfs code only uses > __func__ in 2 places, now including this one. The old nfs code only > uses it in a few more than 2 places. IMO use of __func__ is far preferred to static strings as it follows the printf when it's moved to another function and allows fmt strings to be coalesced by the compiler/loader. I can't count the times I've had a printf w/ the wrong function name send me on a wild goose chase until I grep'd for the remainder of the string. IMO we should be replacing static function names w/ __func__ at every opportunity. Regardless my advise was just that "advise". So long as I can identify the call site in case this error msg gets duplicated I don't care. Sam