From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751376AbdAMJeG (ORCPT ); Fri, 13 Jan 2017 04:34:06 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:39614 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751289AbdAMJeE (ORCPT ); Fri, 13 Jan 2017 04:34:04 -0500 Date: Fri, 13 Jan 2017 09:33:59 +0000 From: Al Viro To: "Alan J. Wylie" Cc: Linus Torvalds , Thorsten Leemhuis , linux-kernel Subject: Re: 4.9.0 regression in pipe-backed iov_iter with systemd-nspawn Message-ID: <20170113093359.GJ1555@ZenIV.linux.org.uk> References: <22647.59020.331664.632444@wylie.me.uk> <22648.1838.747474.51727@wylie.me.uk> <22648.32903.752857.203733@wylie.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22648.32903.752857.203733@wylie.me.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 07:23:51AM +0000, Alan J. Wylie wrote: > at 15:28 on Thu 12-Jan-2017 Linus Torvalds (torvalds@linux-foundation.org) wrote: > > > So assuming Al hasn't figured it out by the time you get back, can > > you try to send us the same strace for the working case? > > Full output at https://wylie.me.uk/tmp/strace1.txt > > 1735 splice(5, NULL, 1, NULL, 9223372036854775807, 0) = -1 EAGAIN (Resource temporarily unavailable) Lovely... So it was getting -EAGAIN all along. Just in case - could you try the delta below and see if it triggers? Simply to exclude the possibility that it *is* this call of splice() and the change has somehow buggered cleanup after the kernel_readv() failure... diff --git a/fs/splice.c b/fs/splice.c index 873d83104e79..1a2d1bc7f19e 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -393,6 +393,9 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos, size_t offset, dummy, copied = 0; ssize_t res; int i; + unsigned nrbufs = pipe->nrbufs, + curbuf = pipe->curbuf, + buffers = pipe->buffers; if (pipe->nrbufs == pipe->buffers) return -EAGAIN; @@ -445,6 +448,16 @@ static ssize_t default_file_splice_read(struct file *in, loff_t *ppos, put_page(pages[i]); kvfree(pages); iov_iter_advance(&to, copied); /* truncates and discards */ + if (res == -EAGAIN && ( + pipe->nrbufs != nrbufs || + pipe->curbuf != curbuf || + pipe->buffers != buffers) + ) { + printk(KERN_ERR "nr: %d->%d, cur: %d->%d, buffers: %d->%d\n", + nrbufs, pipe->nrbufs, + curbuf, pipe->curbuf, + buffers, pipe->buffers); + } return res; }