Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2838501pxb; Sun, 15 Nov 2020 20:32:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+ktQg2G462qhSxX2Hq6OPZwunRF7ECLGavs4iwPJ8KOK4c+01En5e81g6YpbqhNxdo/HX X-Received: by 2002:a17:906:9458:: with SMTP id z24mr13468192ejx.318.1605501177721; Sun, 15 Nov 2020 20:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605501177; cv=none; d=google.com; s=arc-20160816; b=Xo18JAhPv7ICoSh6VvLUPN5OfwJagXj2hZyFqzImK4lymrpGPa3nGHMHr4JHZiKv8k xszPTKC2idvrPrjeWmlEsKg9LAcpFWy+mxXDGq1esk/QJ1F7iz55K2s4rK4I0kucQdvq kxae9mLMjVeVNfzOVwQNklRRx6zcRocgiEYFInhVeDFPT08ysxqwCoEYc6zi8C0k9746 rvrxtfSWyrpqPCqmX9ISaA6U/r9DIp58XY21p/EKgeB1wJCMsYmPs4B42Fk7M6/vguQa wuJW17Vciygr4cTjUYezWHoLzRbE3wuoJdMsQdV6I96HPb9UnHr19Jj+xQxpsAKIZJ9B gRGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=2mT116yPdv4wJuGwwrmkyNCe1ZGK8GmV2COR9lq/LuY=; b=xSbZrx0aVZspOAxl7l4QwH9H3/Zy2YCSOTLaRnbJps5H9zzWlqTmhAlD7C5hA50xv9 LbGwsxGbp6frSJ5AqR/Gk1JZova002Sd+/zdOOwsV+nyg/JVc9B4dr+JLRPX8eUUWn7/ jJ4nMoFq0fkEaAQ4WJGg8Ng8CP36nwtrMudRSyUn4dkVTwh1ri8K6qVl70w6/0KqNICu Pg3X5wR9Q76pyfOV4kvHpIitZFChpNJjHw11+Cv0sXH0MkKIpHQfeOwU3/OE6wtGau0s th3dQRbI6GP+p8tC9l/91xfRsd70u+PCEagUQxgPy58PABvsosu9vAJLjU1eIWieCe9E VJ0w== 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 hb44si2211510ejc.150.2020.11.15.20.32.34; Sun, 15 Nov 2020 20:32:57 -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; 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 S1726545AbgKPD3t (ORCPT + 99 others); Sun, 15 Nov 2020 22:29:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgKPD3t (ORCPT ); Sun, 15 Nov 2020 22:29:49 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B79C0613CF; Sun, 15 Nov 2020 19:29:48 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1keVD4-006zpa-RU; Mon, 16 Nov 2020 03:29:43 +0000 Date: Mon, 16 Nov 2020 03:29:42 +0000 From: Al Viro To: Nathan Chancellor Cc: Linus Torvalds , Christoph Hellwig , Greg KH , Alexey Dobriyan , linux-fsdevel , Linux Kernel Mailing List , kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, linux-hyperv@vger.kernel.org Subject: Re: [PATCH 1/6] seq_file: add seq_read_iter Message-ID: <20201116032942.GV3576660@ZenIV.linux.org.uk> References: <20201114055048.GN3576660@ZenIV.linux.org.uk> <20201114061934.GA658@Ryzen-9-3900X.localdomain> <20201114070025.GO3576660@ZenIV.linux.org.uk> <20201114205000.GP3576660@ZenIV.linux.org.uk> <20201115155355.GR3576660@ZenIV.linux.org.uk> <20201115214125.GA317@Ryzen-9-3900X.localdomain> <20201115233814.GT3576660@ZenIV.linux.org.uk> <20201115235149.GA252@Ryzen-9-3900X.localdomain> <20201116002513.GU3576660@ZenIV.linux.org.uk> <20201116003416.GA345@Ryzen-9-3900X.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116003416.GA345@Ryzen-9-3900X.localdomain> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 15, 2020 at 05:34:16PM -0700, Nathan Chancellor wrote: > Still good. > > Tested-by: Nathan Chancellor Pushed into #fixes > > BTW, is that call of readv() really coming from init? And if it > > is, what version of init are you using? > > I believe that it is but since this is WSL2, I believe that /init is a > proprietary Microsoft implementation, rather than systemd or another > init system: > > https://wiki.ubuntu.com/WSL#Keeping_Ubuntu_Updated_in_WSL > > So I am not sure how possible it is to see exactly what is going on or > getting it improved. Oh, well... Anyway, as a regression test it's interesting: #include #include #include #include main() { static char s[1024]; static struct iovec v[2] = {{NULL, 0}, {s, 1024}}; for(;;) { ssize_t n = readv(0, v, 2), m, w; if (n < 0) { perror("readv"); return -1; } if (!n) return 0; for (m = 0; m < n; m += w) { w = write(1, s + m, n - m); if (w < 0) perror("write"); } } } which ought to copy stdin to stdout; with this bug it would (on sufficiently large seq_file-based files) fail with "readv: Bad address" (-EFAULT, that is).