Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp937751pxb; Wed, 3 Mar 2021 21:46:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8MfhVa6WpZKN4WJ7Rml0hPGDmI8YBKpQu5hWZDaoD3sz1nblD+U/re8TD0sJY12S4a+7k X-Received: by 2002:a17:907:766f:: with SMTP id kk15mr2500400ejc.24.1614836791722; Wed, 03 Mar 2021 21:46:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614836791; cv=none; d=google.com; s=arc-20160816; b=QU9qJyNK7QynGbKhhkH0o8XcCl5p0qQiKahKtve9XCY0gT+E5/nqP68uxbRQUgPICA Qo2SpX3FoIzkqDov71f7vQuQe8oHQQfcfrV/XoskE87atBYO9t1uDgKytgZo8qsLOG6e sFX9VoaMHhqG2y3gwcEwZONQkBDwuDPnYV0EawonrflCZol8eUTn/NrZ+1h5Gynm+6Rf JbBwquUI6viioCjch6JzteC0t72/nq1rMBCTTHrYEFMShJTWCWmLArFXb2qAr5YUeJrG wtKw+454nLupDO1zs0TTu3Dza3wEmNewuT6ByXpTaa2cupwSp3tlHc00gXIEGoYrsLtw aWUg== 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=fzTNoIzBbHR31iQXUPSLVB0C2nz82W+Ep7+3M20aQOg=; b=nDZtMudlyJO/fFhSHl6K5dJt5FQ9PJfNgnFHAzd2OQK/vNTD+KL6SquXH4bs3TypAk HQMJF7ksUMzqK5ghtBJwHQxp5qzu0/oJsd6Gnd0uWuH1hs5MnQSz/MOz6JgT8oaQ5Fr1 K8eSoymXqmwGqeD4nEecTBNschgIBPAJLEFXe8hqLJpsPFugKhcr8CD/DchjyecTF73s IDNHH2ZU6N3rPvkU3oxC96nG6ba/KlCHXF1HcdmBzBW91syPYmdyMtitmuioNF5Io5R+ CtItRSKBOY9JT++v6Y4RZgYW1TaGeELxE2TlbMkjlt7Mn6dvo7SG4vs9JuwV5N9qgKVF ueCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b="m/0eGE9M"; dkim=pass header.i=@codewreck.org header.s=2 header.b="m/0eGE9M"; 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 qo14si2689824ejb.675.2021.03.03.21.46.08; Wed, 03 Mar 2021 21:46:31 -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="m/0eGE9M"; dkim=pass header.i=@codewreck.org header.s=2 header.b="m/0eGE9M"; 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 S242379AbhCBGg1 (ORCPT + 99 others); Tue, 2 Mar 2021 01:36:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835223AbhCBEvD (ORCPT ); Mon, 1 Mar 2021 23:51:03 -0500 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C081C061756; Mon, 1 Mar 2021 20:41:43 -0800 (PST) Received: by nautica.notk.org (Postfix, from userid 108) id D0AE2C020; Tue, 2 Mar 2021 05:38:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614659909; bh=fzTNoIzBbHR31iQXUPSLVB0C2nz82W+Ep7+3M20aQOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m/0eGE9M4O/xg+5IVrbVCVUg9axHbEh6li08QUJ5XKQo0JAMws92pVSZAPIAwzedo hauWxgPPtvst6YsRMtRP6YB5gtk1pmGqLMrjlyuFBmwvBMhk+Z74VaUGIAVil+PClX LKfLe0RfsmZEtlR9K0Jfba9sb8gSPVc6TMBbSk71NRcJeVF8ThUiaJzgw5U4usXgov FklMHFa0iKVGmsAxE1P2bj8EzazFVvl4t50qreA/ZEUIEyaga30Xw6CgAIIgekcHSk bOByPK2u3W73aeHrTs1F0pG5bG3+7Ho2dK6uWDIfuxumAlVdKFXGU6jJxKR1gDxfnT YUhKFRlrsZ7/A== X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on nautica.notk.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id AAE49C01B; Tue, 2 Mar 2021 05:38:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614659909; bh=fzTNoIzBbHR31iQXUPSLVB0C2nz82W+Ep7+3M20aQOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m/0eGE9M4O/xg+5IVrbVCVUg9axHbEh6li08QUJ5XKQo0JAMws92pVSZAPIAwzedo hauWxgPPtvst6YsRMtRP6YB5gtk1pmGqLMrjlyuFBmwvBMhk+Z74VaUGIAVil+PClX LKfLe0RfsmZEtlR9K0Jfba9sb8gSPVc6TMBbSk71NRcJeVF8ThUiaJzgw5U4usXgov FklMHFa0iKVGmsAxE1P2bj8EzazFVvl4t50qreA/ZEUIEyaga30Xw6CgAIIgekcHSk bOByPK2u3W73aeHrTs1F0pG5bG3+7Ho2dK6uWDIfuxumAlVdKFXGU6jJxKR1gDxfnT YUhKFRlrsZ7/A== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id 7ce2726f; Tue, 2 Mar 2021 04:38:23 +0000 (UTC) Date: Tue, 2 Mar 2021 13:38:08 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210301110157.19d9ad4e@xhacker.debian> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jisheng Zhang wrote on Mon, Mar 01, 2021 at 11:01:57AM +0800: > Per my understanding of iov_iter, we need to call iov_iter_advance() > even when the read out count is 0. I believe we can see this common style > in other fs. I'm not sure where you see this style, but I don't see exceptions for 0-sized read not advancing the iov in general, and I guess this makes sense. Rather than make an exception for 0, how about just removing the if as follow ? I've checked that the non_zc case (copy_to_iter with 0 size) also works to the same effect, so I'm not sure why the check got added in the first place... But then again this is old code so maybe the semantics changed since 2015. ---- diff --git a/net/9p/client.c b/net/9p/client.c index 4f62f299da0c..0a0039255c5b 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1623,11 +1623,6 @@ p9_client_read_once(struct p9_fid *fid, u64 offset, struct iov_iter *to, } p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", count); - if (!count) { - p9_tag_remove(clnt, req); - return 0; - } - if (non_zc) { int n = copy_to_iter(dataptr, count, to); ---- If you're ok with that, would you mind resending that way? I'd also want the commit message to be reworded a bit, at least the first line (summary) doesn't make sense right now: I have no idea what you mean by "free what was emitted". Just "9p: advance iov on empty read" or something similar would do. > > cat version? coreutils' doesn't seem to do that on their git) > > busybox cat Ok, could reproduce with busybox cat, thanks. As expected I can't reproduce with older kernels so will run a bisect for the sake of it as time allows -- Dominique