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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20F60C433DB for ; Mon, 1 Mar 2021 02:52:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0FF060C3D for ; Mon, 1 Mar 2021 02:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbhCACwe (ORCPT ); Sun, 28 Feb 2021 21:52:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbhCACwc (ORCPT ); Sun, 28 Feb 2021 21:52:32 -0500 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BCD1C061756; Sun, 28 Feb 2021 18:51:51 -0800 (PST) Received: by nautica.notk.org (Postfix, from userid 108) id E5474C022; Mon, 1 Mar 2021 03:51:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614567105; bh=F+Lh7tLgOo+TtdtsS58P5I40l0lHx/XnMQ8Qg4cItMI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RDR84AsQhMDUKebBJySfKhAIbESMHKQUzVysTTShIWc47NyTmZkjnLjW1gJR3fH9A sDQmHdcOEfumBRyccrv+lP4W5AByVZeNNDkRq5AHBzG3BxWS5qyubPJtb5qja0XP7R ehrTtbbOVF8Alo8asNJxuUYAoHSnUghW/8e7pnRej/ngxaVaK3aovH9W/HsMzNX05M LjMbJ+6+uEisMM1VoElf27kB/1WoX+d0GIX3ZnxuO3Eb6aJkPYffHH4PigHEEhxGAP Mgfcx7VbfIhPpKUk8iXjj6xpmGD6ds7SFNdnLWwB/WiYIle75rv9Ci6OVkYN1kMasv gI1Dv1ZYcFNDQ== Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id B6E52C01B; Mon, 1 Mar 2021 03:51:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1614567105; bh=F+Lh7tLgOo+TtdtsS58P5I40l0lHx/XnMQ8Qg4cItMI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RDR84AsQhMDUKebBJySfKhAIbESMHKQUzVysTTShIWc47NyTmZkjnLjW1gJR3fH9A sDQmHdcOEfumBRyccrv+lP4W5AByVZeNNDkRq5AHBzG3BxWS5qyubPJtb5qja0XP7R ehrTtbbOVF8Alo8asNJxuUYAoHSnUghW/8e7pnRej/ngxaVaK3aovH9W/HsMzNX05M LjMbJ+6+uEisMM1VoElf27kB/1WoX+d0GIX3ZnxuO3Eb6aJkPYffHH4PigHEEhxGAP Mgfcx7VbfIhPpKUk8iXjj6xpmGD6ds7SFNdnLWwB/WiYIle75rv9Ci6OVkYN1kMasv gI1Dv1ZYcFNDQ== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id 090953bd; Mon, 1 Mar 2021 02:51:39 +0000 (UTC) Date: Mon, 1 Mar 2021 11:51:24 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210301103336.2e29da13@xhacker.debian> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Jisheng Zhang wrote on Mon, Mar 01, 2021 at 10:33:36AM +0800: > I met below warning when cating a small size(about 80bytes) txt file > on 9pfs(msize=2097152 is passed to 9p mount option), the reason is we > miss iov_iter_advance() if the read count is 0, so we didn't truncate > the pipe, then iov_iter_pipe() thinks the pipe is full. Fix it by > calling iov_iter_advance() on the iov_iter "to" even if read count is 0 Hm, there are plenty of other error cases that don't call iov_iter_advance() and shouldn't trigger this warning ; I'm not sure just adding one particular call to this is a good solution. How reproducible is this? From the description it should happen everytime you cat a small file? (I'm surprised cat uses sendfile, what cat version? coreutils' doesn't seem to do that on their git) What kernel version do you get this on? Bonus points if you can confirm this didn't use to happen, and full points for a bisect. (cat on a small file is something I do all the time in my tests, I'd like to be able to reproduce to understand the issue better as I'm not familiar with that part of the code) Thanks, -- Dominique