From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdAMUL0 (ORCPT ); Fri, 13 Jan 2017 15:11:26 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:56198 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751048AbdAMULX (ORCPT ); Fri, 13 Jan 2017 15:11:23 -0500 Date: Fri, 13 Jan 2017 20:11:21 +0000 From: Al Viro To: Linus Torvalds Cc: "Alan J. Wylie" , Thorsten Leemhuis , linux-kernel Subject: Re: 4.9.0 regression in pipe-backed iov_iter with systemd-nspawn Message-ID: <20170113201121.GQ1555@ZenIV.linux.org.uk> References: <22648.1838.747474.51727@wylie.me.uk> <22648.32903.752857.203733@wylie.me.uk> <20170113093359.GJ1555@ZenIV.linux.org.uk> <22648.41914.351371.678606@wylie.me.uk> <20170113102019.GK1555@ZenIV.linux.org.uk> <20170113111842.GL1555@ZenIV.linux.org.uk> <20170113200826.GP1555@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170113200826.GP1555@ZenIV.linux.org.uk> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2017 at 08:08:27PM +0000, Al Viro wrote: > Because it's "truncate to size", not "throw everything up to that point > out". > > We have some amount of data pushed into pipe (in this case - 0) and we > have some buffers allocated by ..._get_pages() past the end of it. > Some of that we want to keep (again, in this case - none) and have the next > copy_to_iter() go after those, the rest we discard. PS: 'size' argument of iov_iter_advance() is the second "some" in the above - we tell it how much we want to advance by and everything past that point is, in case of PIPE_ITER, discarded.