Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2791035pxk; Sun, 20 Sep 2020 18:00:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH+oSCX95fr4db5bLEILl4vBawRL4X8y0RBWbMKLYuJL39ksmdkf1rzl3NZPFX6l8T6H0S X-Received: by 2002:a17:906:4f16:: with SMTP id t22mr46893352eju.40.1600650006619; Sun, 20 Sep 2020 18:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600650006; cv=none; d=google.com; s=arc-20160816; b=TBmifQ/d8+3sxCvgfnQBjxcxsYKJOjSGbUBGTc4Fe25pzf9FD08NO33gWf8JuQwELe ZfEiZN2XL0oLjfSRR9lJFLfPhdlw5qNWeww5kQzHKhKMlGJ57BJYh7fqDY0MQBN0gJdi H4wIcVAjaDop6cJs6aqjLbDvl/aJMqcTfTUXd6TkBiMnn+yNHO0vzmfQJdoAJGJ1plWV zDSDdD6tE8oGf+6G0Znm0WYhfaVt1gGS+3P47LteRq/37PtF6e597vTUdTZVPjPUFMJW 6ON1GE0+HjD8temfY5n1UGfh6JSeMPpF+ZEA3IL/rHhUUK3s/7KaOfNzgQYHkw6LPVOt j13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to; bh=VAv5ZRH5xoJ2QOAvV/Pgg75z5GNjCD9fImXzXrtdIdc=; b=s5qa0wVdzP8jSuEXcbFoLqoFJ8LPlPn2KX8nT5lDhhJgDpMbLnUj/zhbThf73jE4eg sxYWdv0fdHWuxfeSBcdE4Sfuiq8bntR0GN05iglQvl2hqWFqzbpjoq4sYDr2YVLz6+2s L/gF69wVXvNZm3IYr6GV6eXAhWEziyffTeHy+y07vEH5PhSCCPOpH7+wgT7/s9jjzOL3 +ANd+7+dQH6BrZHUgCyZU6G2aZlU4y/PzAcUI35EZyQKJn2lDNUpv0eh0faZ7NaK9cKG s+s8LNGdne+iBa3kPyV6MCTApfquff7HvLVDbX/qW836B/8/3cCBE8TaYAPUwok1Ppvb Ix3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si7143584ejs.611.2020.09.20.17.59.40; Sun, 20 Sep 2020 18:00:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbgIUA5b (ORCPT + 99 others); Sun, 20 Sep 2020 20:57:31 -0400 Received: from smtp.infotech.no ([82.134.31.41]:45464 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbgIUA5a (ORCPT ); Sun, 20 Sep 2020 20:57:30 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 90ABB20424C; Mon, 21 Sep 2020 02:57:28 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id giJNlnowmhTX; Mon, 21 Sep 2020 02:57:22 +0200 (CEST) Received: from [192.168.48.23] (host-45-78-251-166.dyn.295.ca [45.78.251.166]) by smtp.infotech.no (Postfix) with ESMTPA id 3FF2020417C; Mon, 21 Sep 2020 02:57:20 +0200 (CEST) Reply-To: dgilbert@interlog.com Subject: Re: [PATCH] lib/scatterlist: Fix memory leak in sgl_alloc_order() To: Markus Elfring , linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Bart Van Assche , Jens Axboe References: <1608a0b7-6960-afce-aa39-6785036b01e0@interlog.com> From: Douglas Gilbert Message-ID: <9ee6e304-0f96-ea5b-f1ca-84e57345b237@interlog.com> Date: Sun, 20 Sep 2020 20:57:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-20 4:11 p.m., Markus Elfring wrote: >>>> Noticed that when sgl_alloc_order() failed with order > 0 that >>>> free memory on my machine shrank. That function shouldn't call >>>> sgl_free() on its error path since that is only correct when >>>> order==0 . >>> >>> * Would an imperative wording become helpful for the change description? > … >> … and the term "imperative wording" rings no >> bells in my grammatical education. … > > I suggest to take another look at the published Linux development documentation. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=bdcf11de8f776152c82d2197b255c2d04603f976#n151 > > >>> * How do you think about to add the tag “Fixes” to the commit message?r >> >> In the workflow I'm used to, others (closer to LT) make that decision. >> Why waste my time? > > I find another bit of guidance relevant. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=bdcf11de8f776152c82d2197b255c2d04603f976#n183 > > >>> * Will an other patch subject be more appropriate? >> >> Twas testing a 6 GB allocation with said function on my 8 GB laptop. >> It failed and free told me 5 GB had disappeared … > … > > Have we got any different expectations for the canonical patch subject line? > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=bdcf11de8f776152c82d2197b255c2d04603f976#n684 > > I am curious how the software will evolve further also according to your > system test experiences. Sorry, I didn't come down in the last shower, it's not my first bug fix. Try consulting 'git log' and look for my name or the MAINTAINERS file. The culprits are usually happy as was the case with this patch. It's ack-ed and I would be very surprised if Jens Axboe doesn't accept it. It is an obvious flaw. Fix it and move on. Alternatively supply your own patch that ticks all the above boxes. If you want to talk about something substantial, then why do we have a function named sgl_free() that only works properly if, for example, the sgl_alloc_order() function creating the sgl used order==0 ? IMO sgl_free() should be removed or renamed. Doug Gilbert BTW The "imperative mood" stuff in that document is nonsense, at least in English. Wikipedia maps that term back to "the imperative" as in "Get thee to a nunnery" and "Et tu, Brute".