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=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 76CE3C56201 for ; Wed, 11 Nov 2020 07:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A3D7206B5 for ; Wed, 11 Nov 2020 07:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbgKKHzr (ORCPT ); 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.