Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp944465pxb; Wed, 3 Mar 2021 22:02:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0qDbradZXJbMuu2FOT/GqHziWBio/D9A8DylNVwgiTnSU4KJ6pQVCgO1FDd5Pv5q1s9hq X-Received: by 2002:aa7:cf95:: with SMTP id z21mr2569448edx.76.1614837722883; Wed, 03 Mar 2021 22:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837722; cv=none; d=google.com; s=arc-20160816; b=tzF/Lkic7SWVLmLWBXLZo98N/uepjzK55ZybXUisG8DLxW/v//QmozSr24UWB2s+/w rJP3q2tZa1cjujEmZLXGEMPmYfSY17x8dWmRuHsuaGIhMsQxQiIngQvD8AZx5zqBMeMd O42hx++rA8IbfmRkI1UobcxRBMCIrrvAA4yT4kap9247HnZZjv+CzIlvqZOeuQyt9VCP vzj123buEkS11JzWo/d0+6RY0eFAYxhlpS/NmSLSZjIEK65V1YMS0nz3FmMkZn3SPjCr Uz7tczhHlAPa2Ol6miJ3wylqotzO8F89yPT8CZ9ashqlBhL4dqJjp4AUhZaZm17U4hW0 fXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=jo1ApVji+2tQwiUYRWmYN3Y+RBqiduiLhHfkJ1tbAVI=; b=T9RjvEhvLDzbJIKH/dnDwENTLx8qKsDUoMzyd6yg5LNkXoktkg7+0RTZfnr0njI/s5 pEShJxkjOLy2pk1iNzBvrpe1itQRhIP9DaYhiWnsdXB86DlvWJollZttQsLFqV0jtLEg Htuwv8lhm3WGVenzifr2ki9x8jkYjD89hne34uDV36XNp4dTsXi8oedXcFNDdcx39t6s E9LhV1wg9VEYjZ2DNEiuddjV/VQXIUkNzheF88+6foP0v7p7W2Owdz9h6yMMoioaPU6R OzBsBCOWILdlkYZd9X3HdKKORrNnCI9rdnv/aHc9pFm1QrJPeq9RCJQAx/YikycGZnt8 ovOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=0cNN7pnl; dkim=pass header.i=@codewreck.org header.s=2 header.b=OpT+RaVX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si15943546ejd.179.2021.03.03.22.01.40; Wed, 03 Mar 2021 22:02:02 -0800 (PST) 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; dkim=pass header.i=@codewreck.org header.s=2 header.b=0cNN7pnl; dkim=pass header.i=@codewreck.org header.s=2 header.b=OpT+RaVX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235511AbhCBIUj (ORCPT + 99 others); Tue, 2 Mar 2021 03:20:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237977AbhCBIJS (ORCPT ); Tue, 2 Mar 2021 03:09:18 -0500 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE3ACC061756; Tue, 2 Mar 2021 00:08:35 -0800 (PST) Received: by nautica.notk.org (Postfix, from userid 108) id 33EC8C01B; Tue, 2 Mar 2021 09:08:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614672514; bh=jo1ApVji+2tQwiUYRWmYN3Y+RBqiduiLhHfkJ1tbAVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0cNN7pnls8BE7DnPzkHaXGu9tEd7hrNWUN75AnMdJUaMT8PBKw9A5YNP1gSwEDhIR 54cJ4nh030YM7fLrUCymQGkKNu6aRtQryhME1O/sUHfJdkGtmXQM8HasmFjvsPbQ4o WiP8E8lFetzeLpp1AXF/WyLKo8vkl7Sfk/GIcx2fWrx7iunSrUIjOR//9zvQGBaT59 frfOWbOTxTQUDjM81C+iM1/mDtnSPZkTuHQBeOxQ4uqXzEo6aL6K74pxUHfmXj5brP M/av2VPnLFEFKkTgO8KVSJskh8ZMlRGwFWtxfgEdQJ2mvB/91q5LRxvEYtIJrPunkY mgvpEYktQr5Bw== X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on nautica.notk.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 161F1C01B; Tue, 2 Mar 2021 09:08:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614672513; bh=jo1ApVji+2tQwiUYRWmYN3Y+RBqiduiLhHfkJ1tbAVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OpT+RaVXKbY5pxROi3uyhFf/WrZ1CFSp2mGEdK3FHtTsafFaLFy2HkJI9r36aDLCT Lj+tn4GZ/4CG9uFLG06ApZEuI4vv7dtKHXzZiZTv/jDnOk4vJjy0dgfND1PDWbzZEV WGaVPsYBZrN1u6C9RrBco3Ta+kt3I5xp4CUoVA2eF1rfHUKeMPxyCPZyWrl665TfBc x+Z3lTMBwcbUkUluwbdbmPQDbfIRHhjhmBADcqktEBG+1lIBs90BuUu1HpVp0yOOcK gl6yXLay7POrbiOxIDbPGnQXDWrR0FxXxo4087PmV+YZ/z8ZCashmSPIzax84UaXdo haWi3jPnkh1dQ== Received: from odin (localhost [127.0.0.1]) by odin.codewreck.org (OpenSMTPD) with ESMTP id af406e63; Tue, 2 Mar 2021 08:08:28 +0000 (UTC) Date: Tue, 2 Mar 2021 17:08:13 +0900 From: Dominique Martinet To: Jisheng Zhang Cc: Eric Van Hensbergen , Latchesar Ionkov , "David S. Miller" , Jakub Kicinski , v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: 9p: free what was emitted when read count is 0 Message-ID: References: <20210301103336.2e29da13@xhacker.debian> <20210301110157.19d9ad4e@xhacker.debian> <20210302153940.64332d11@xhacker.debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210302153940.64332d11@xhacker.debian> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jisheng Zhang wrote on Tue, Mar 02, 2021 at 03:39:40PM +0800: > > Rather than make an exception for 0, how about just removing the if as > > follow ? > > IMHO, we may need to keep the "if" in current logic. When count > reaches zero, we need to break the "while(iov_iter_count(to))" loop, so removing > the "if" modifying the logic. We're not looking at the same loop, the break will happen properly without the if because it's the return value of p9_client_read_once() now. In the old code I remember what you're saying and it makes sense, I guess that was the reason for the special case. It's not longer required, let's remove it. -- Dominique