From owner-svn-src-all@FreeBSD.ORG Tue Feb 10 02:36:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03A38A2B; Tue, 10 Feb 2015 02:36:19 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA488F44; Tue, 10 Feb 2015 02:36:18 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NJJ00N29B7W4W20@st11p02mm-asmtp002.mac.com>; Tue, 10 Feb 2015 02:35:58 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-02-10_01:2015-02-09,2015-02-10,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1502100023 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: svn commit: r278479 - in head: etc sys/kern From: Rui Paulo In-reply-to: <20150209232826.GJ42409@kib.kiev.ua> Date: Mon, 09 Feb 2015 18:35:55 -0800 Content-transfer-encoding: 7bit Message-id: References: <201502092313.t19NDpoS083043@svn.freebsd.org> <20150209232826.GJ42409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.2070.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 10 Feb 2015 02:36:19 -0000 On Feb 9, 2015, at 15:28, Konstantin Belousov wrote: > Arguably, there should be a knob, probably sysctl, to turn the > functionality off. I definitely do not want this on crash boxes used for > userspace debugging. Even despite the example handler is inactive. OK, I can provide a sysctl knob. >> + len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1; > It is much cleaner to use static const char arrays for the names, > and use sizeof() - 1 instead of hard-coding commented constants. OK. I was trying to avoid allocating >2k on the stack. >> + data = malloc(len, M_TEMP, M_NOWAIT); > Why is this allocation M_NOWAIT ? That should be M_WAITOK. >> + freepath = NULL; >> + } >> + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) >> + goto out; >> + snprintf(data, len, "%s core=%s", data, fullpath); > This is weird, and highly depends on the implementation details, supplying > the same string as target and source. IMO strcat(9) is enough there. OK, I'll change it to strcat. -- Rui Paulo