From owner-svn-src-head@freebsd.org Mon Jan 8 20:54:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA5BDE6194F for ; Mon, 8 Jan 2018 20:54:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-37.consmr.mail.gq1.yahoo.com (sonic303-37.consmr.mail.gq1.yahoo.com [98.137.64.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B34107428C for ; Mon, 8 Jan 2018 20:54:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1515444889; bh=iEC/mt6zffQ+/zwfu+XtNCn6QggpYN7DB0vLjNpx4Ws=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=V07PXJcfkm47eaik4k7gF2/SJIhHsM3H8TFJTxN2cltxnVgYRgddgxTUGULdVZkUCGVIUEZmefodoWZBuM0kF772ANCEmioQwuRtVrdrLZptUbG9gzDE0aaSM2FDe8GfpdUV//m3+saNpdk9jLdxvdrZYIHFEBtrMbAAa5sV3HHFVcz8vvWenum7IAt4RZxTHhivrU0a/h6yppyVX/fGxE5/jwYOwOjtcl9etmRuKGNCPbCN3kGb/cw/gz7z39Nk3rtKatVsr2hT/DR+UD/z+F9pywuZzlfs+VhfhdnESRlMQxznEY2euQYRrIVQB+ZRAlzA8mhzIxtcYxRGHVSnxg== X-YMail-OSG: 6.QGtxEVM1kQ1RUq5HhxbejaQEeRXzn8VKD6Sgy5vqN3tzwG8LY3iqyKk.ehc4x orCik4LmWzlB92KKOwD8ti8.0Ilpc7O88Fm.PJE58zC2JTh4FLRiGFDUpfq3kuV8MKasO3N7Yrc5 ZEMFzcaojYaYQN1Fb3GLYRch0Gg2GfzLXEZQion5NMvgzZ5hCH_3G62wf7z1s2kML6yQ0eMB3Hii BXemOhFxAxwUFzTWYdh1xCeAiv1XofxQA2kb57WYz0Cil.40n.rlxIurmZG4oqhIKzxsI1kLFJkj y6ikDan8z9VyOTyFE7o70HhqLbh64gW12yOPf449LbKySjvnjewvyAjDXfS4Ff7RnyhOb3qcpJnJ NSwJIz_p2GDVjQm8xiG8Fz8q2AXVAeS56Ywc3v9e73IdlHlADus0DHNseEP_JyVfmxWWA6wT._Bk TPes_0L.Hjq6YAJpi.Gx8rMmgKp2bmMLTF62SDNuZGrL.RIO.JWNMcwU075zG_d30ZOWRW3J. Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jan 2018 20:54:49 +0000 Received: from smtp110.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.6]) ([216.39.57.225]) by smtp403.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 281cf99df4003b4738c94627c89ec3de; Mon, 08 Jan 2018 20:54:44 +0000 (UTC) Subject: Re: svn commit: r327699 - head/sys/sys To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801081609.w08G9941022351@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <89964e3f-a982-f0e5-a7ff-9c13a5ebe61c@FreeBSD.org> Date: Mon, 8 Jan 2018 15:54:45 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Mon, 08 Jan 2018 20:54:56 -0000 Hello; On 08/01/2018 15:27, Conrad Meyer wrote: > I'm (again, atypically) with rgrimes here. Revert has a specific > meaning and shouldn't be used like this. Making a commit with the > subject "Revert rXXX" that does more than just "svn revert rXXX" makes > life harder for developers looking at code history after you. Making > two separate commits for two different changes (revert, then add the > annotation) is not burdensome. > > Best, > Conrad Yeah, I understand where that comes from and I will take it into account for future commits, but I think it should be *documented* and not assume that everybody  thinks that is the way version control is supposed to be used. Pedro. > On Mon, Jan 8, 2018 at 12:18 PM, Pedro Giffuni wrote: >> On 08/01/2018 11:09, Rodney W. Grimes wrote: >>>> Author: pfg >>>> Date: Mon Jan 8 15:54:29 2018 >>>> New Revision: 327699 >>>> URL: https://svnweb.freebsd.org/changeset/base/327699 >>>> >>>> Log: >>>> Revert r327697: >>>> malloc(9): drop the __result_use_check attribute for the kernel >>>> allocator. >>>> My bad: __result_use_check just checks the for the general and we >>>> always >>>> want to make sure allocated memory is used, not only checked for >>>> nullness. >>>> Add it to reallocf since that was missing. >>> Please try not to combine a revert with an add, it makes it messy >>> to try and figure out things in the future when only the svn log >>> is being used to analyze stuff as digging in mail archives becomes >>> painful. >>> >>> Revert, then commit the add standalone, is the better sequence in >>> this type of situation. >> >> Not that any of this is defined in our committers guide but IMHO "svn >> revert" is just a tool, pretty much as "svn move" and "svn copy". The idea >> is to make a committers' life easier: making two commits for such a simple >> change is not "easier". >> >> In this case the change is rather consistent: I added __result_use_check to >> the three functions that needed it. >> The commit log is not only clear on why the revert happened but also >> explains the additional one line change. >> >> When I MFC it, I will merge both changes for repository consistency but the >> log will basically mention that I am adding __result_use_check to >> reallocf(). >> >> >> Pedro. >> >>>> Modified: >>>> head/sys/sys/malloc.h >>>> >>>> Modified: head/sys/sys/malloc.h >>>> >>>> ============================================================================== >>>> --- head/sys/sys/malloc.h Mon Jan 8 15:41:49 2018 (r327698) >>>> +++ head/sys/sys/malloc.h Mon Jan 8 15:54:29 2018 (r327699) >>>> @@ -176,7 +176,7 @@ void *contigmalloc(unsigned long size, struct >>>> malloc_t >>>> __alloc_size(1) __alloc_align(6); >>>> void free(void *addr, struct malloc_type *type); >>>> void *malloc(unsigned long size, struct malloc_type *type, int flags) >>>> - __malloc_like __alloc_size(1); >>>> + __malloc_like __result_use_check __alloc_size(1); >>>> void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, >>>> int flags) __malloc_like __result_use_check >>>> __alloc_size(1) __alloc_size(2); >>>> @@ -187,9 +187,9 @@ void malloc_type_freed(struct malloc_type >>>> *type, unsig >>>> void malloc_type_list(malloc_type_list_func_t *, void *); >>>> void malloc_uninit(void *); >>>> void *realloc(void *addr, unsigned long size, struct malloc_type >>>> *type, >>>> - int flags) __alloc_size(2); >>>> + int flags) __result_use_check __alloc_size(2); >>>> void *reallocf(void *addr, unsigned long size, struct malloc_type >>>> *type, >>>> - int flags) __alloc_size(2); >>>> + int flags) __result_use_check __alloc_size(2); >>>> struct malloc_type *malloc_desc2type(const char *desc); >>>> #endif /* _KERNEL */ >>>> >>>> >> Pedro. >>