Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp165091pxb; Tue, 10 Nov 2020 23:58:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLDc8npdCAobvNyACIsOvh/9IUq4EsqKGlYR752xnR3vuIpg5mMmoZwcs/anK8mmuMelag X-Received: by 2002:a50:d582:: with SMTP id v2mr25661754edi.218.1605081507050; Tue, 10 Nov 2020 23:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605081507; cv=none; d=google.com; s=arc-20160816; b=k8RY5iUXHYgzxveRoFEt2NnIXAl35i5CCGuBUs3Tr0qoLovkEa20wKTXrTVVRBywoG UJTAoa9LfWVfZfQM7WwCIcpmzckAzfnsMqwkdDZZEvvOFP2AOsxEc1rfYMgn9RHZG3+5 FgL4PFPPOMchgjqpI9CXBAq/iZyGXbog6b765fBwMtGQPVSvZOSiqLjQuxgroR5kbNEq fAXKaMV5mSjcCSZU9HSeOg+whz36pA6lHCmxbvdZEJoMVKuhxULR4oq6gJ9BqSzUU1Gc hdroe2ppn9Wiv3xGARVyvKyapeV5/RZ+4thZXG3s8zkpo1WXP7fhLms1B56boZeBH2VL J2pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=FKfR1Aq5RQRUYNLokUWhU2RN3FU/wAqjRNymQfJlxTM=; b=tsGzQC4nqtgvBOZtVuoBPZxgfiGjgwRZXrgelmCXAEEXVEI1iAwsfvrpJvDFqDJuVQ gVK/GSRkxeRlvHzODcNLFhhFW+iGEpxjRPA3aoVeWJeDlSKQBI1xchGJ4UcVq+u+wFqS QdiLGvNPqhtMV14XR87/qOyxOta1UPW/RWX88WwgK2ToxB640v+xvQyemihMpVr9TFs0 8/CtfBxXcT7rdAvQYkbwNE/cvcBn0DCKyHTHbi/bZLbud7t48CSc7EaUF/Y2X5O+8d51 ylSlHvVuasvtrjIgxBh2CpTdrnrIjUnXpKopP/Qig42MNyXuhHb1ilcLqaZ41OauDEO0 Gh2A== 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 e4si891985eds.412.2020.11.10.23.58.03; Tue, 10 Nov 2020 23:58:27 -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 S1726215AbgKKHzr (ORCPT + 99 others); Wed, 11 Nov 2020 02:55:47 -0500 Received: from verein.lst.de ([213.95.11.211]:39061 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbgKKHzq (ORCPT ); Wed, 11 Nov 2020 02:55:46 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id C12F867373; Wed, 11 Nov 2020 08:55:43 +0100 (CET) Date: Wed, 11 Nov 2020 08:55:43 +0100 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Greg KH , Linus Torvalds , Alexey Dobriyan , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] seq_file: add seq_read_iter Message-ID: <20201111075543.GA22916@lst.de> References: <20201104082738.1054792-1-hch@lst.de> <20201104082738.1054792-2-hch@lst.de> <20201110213253.GV3576660@ZenIV.linux.org.uk> <20201110213511.GW3576660@ZenIV.linux.org.uk> <20201110232028.GX3576660@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110232028.GX3576660@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 11:20:28PM +0000, Al Viro wrote: > On Tue, Nov 10, 2020 at 09:35:11PM +0000, Al Viro wrote: > > On Tue, Nov 10, 2020 at 09:32:53PM +0000, Al Viro wrote: > > > > > AFAICS, not all callers want that semantics, but I think it's worth > > > a new primitive. I'm not saying it should be a prereq for your > > > series, but either that or an explicit iov_iter_revert() is needed. > > > > Seeing that it already went into mainline, it needs a followup fix. > > And since it's not -stable fodder (AFAICS), I'd rather go with > > adding a new primitive... > > Any objections to the following? > > Fix seq_read_iter() behaviour on full pipe > > generic_file_splice_read() will purge what we'd left in pipe in case > of error; it will *not* do so in case of short write, so we must make > sure that reported amount of data stored by ->read_iter() matches the > reality. > > It's not a rare situation (and we already have it open-coded in at least > one place), so let's introduce a new primitive - copy_to_iter_full(). > Similar to copy_from_iter_full(), it returns true if we had been able > to copy everything we'd been asked to and false otherwise. Iterator > is advanced only on success. > > Signed-off-by: Al Viro Looks ok to me.