From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 722C7EB64DA for ; Mon, 10 Jul 2023 17:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231163AbjGJRC1 (ORCPT ); Mon, 10 Jul 2023 13:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjGJRCZ (ORCPT ); Mon, 10 Jul 2023 13:02:25 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB08ABB for ; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-682ae5d4184so1016627b3a.1 for ; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689008543; x=1691600543; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=twIKQ2MHmWju5IY9XdGeqwYNLAm5VOVmCmH1cwAeJvk=; b=sprGqyuTIkmhlp/iXd5gmNH66qzxiDBk8Cam7K03v2kzxqK9/AFYFQvGhIE1D4y/PY mgSHU0aplUx66upCzdNow5DVpTrfAY2q407OHNIoA+nTIyH3oMpGtxM8Cb3gIHwlGpWN l6v3kltpBon+nO1yEEILHeHPbORVFoQ6qJ2DwMiqvrNWHdwr3LAJtsr0xoTCAyloTuR7 5VekZ5DWDlNYCoXiZc6B3++nUd6Pxl4xfJFwEGeQX5hADWaGGbYzlUl5DSYc9B3CROP4 kxkNeIbm6TmTeZDMzQo4TSmhUXqz9V/lVHLrEpjVqIqdIvjfLg0XDCVu+4kkSWpW++Kp FT5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689008543; x=1691600543; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=twIKQ2MHmWju5IY9XdGeqwYNLAm5VOVmCmH1cwAeJvk=; b=ZxhouXaVsfCVUQ4pwObdOAYvFVi0VZxs4d2ev3d/4F7VBCaOofDWVlISASe10GNh9v W6M7Rj2ZbE/JL9AyCBFTComHDmuWa2r+5kKR1zfCaC72jZU8Eac8HiEQRxB4K3cEAASs BCybiva723LN1QSZ4syC+2Era7heu1zKiCMurEw2FSJm3RHWm/ycYfRIgWNx4TQ1r+2X qtmA3aNPqI/GPU/m7IKWzGvxbLvXo9C8CGeVTYISAUGKMFInxAcPamAWkrmMnimTLLnk 7hi3eMGXgQq3eY9/i2eWO8R/gz9H2E1+MjXQCalORFf6kQTuIQp+frvPWq99+IIFaUzb nA5g== X-Gm-Message-State: ABy/qLYRlnYbtYC16ZUqdLnhsJADk5c7prtNHrHEF3thkW/oJOY8dG50 2c7sM0uGC2gAjXOaLjRbkiiKJSDWLuhjnbGWck4= X-Google-Smtp-Source: APBJJlHedqKsKuyUaPZ0noHnVu/heeqrZZBf1PjMGnOYJMAaqmONjhnkrTFZWY2hVKZgNlfBPFnRDw== X-Received: by 2002:a05:6a00:3a2a:b0:675:8521:ddc7 with SMTP id fj42-20020a056a003a2a00b006758521ddc7mr15664306pfb.0.1689008543234; Mon, 10 Jul 2023 10:02:23 -0700 (PDT) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id a17-20020aa78651000000b006828ee9fdaesm29514pfo.127.2023.07.10.10.02.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 10:02:22 -0700 (PDT) Message-ID: <7e8c910f-4938-01c2-ac38-7ce89236cec1@kernel.dk> Date: Mon, 10 Jul 2023 11:02:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] io_uring: Redefined the meaning of io_alloc_async_data's return value Content-Language: en-US To: Gabriel Krisman Bertazi , Lu Hongfei Cc: Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com References: <20230710090957.10463-1-luhongfei@vivo.com> <87o7kjr9d9.fsf@suse.de> From: Jens Axboe In-Reply-To: <87o7kjr9d9.fsf@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/10/23 10:58?AM, Gabriel Krisman Bertazi wrote: > Lu Hongfei writes: > >> Usually, successful memory allocation returns true and failure returns false, >> which is more in line with the intuitive perception of most people. So it >> is necessary to redefine the meaning of io_alloc_async_data's return value. >> >> This could enhance the readability of the code and reduce the possibility >> of confusion. > > just want to say, this is the kind of patch that causes bugs in > downstream kernels. It is not fixing anything, and when we backport a > future bugfix around it, it is easy to miss it and slightly break the > semantics. Exactly! This is also why I'm not a fan of patches like this, and was not intending to apply it. > That's my downstream problem, of course. But at least it would be good Strictly speaking it is, but I think we have a responsibility to not have core bits be different upstream "just because". IOW, making it harder to introduce problems when backporting. And fwiw, I'm not sure I agree on the idiomatic part of it. Lots of functions return 0 for success and non-zero for an error. It's a bit odd as this one is a bool, but I'm pretty sure it used to return an actual error and this is why it looks the way it currently does. -- Jens Axboe