Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753785AbdDKXsZ (ORCPT ); Tue, 11 Apr 2017 19:48:25 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36538 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753098AbdDKXsW (ORCPT ); Tue, 11 Apr 2017 19:48:22 -0400 Date: Wed, 12 Apr 2017 00:48:21 +0100 From: Al Viro To: Dave Jones , Linux Kernel Subject: Re: iov_iter_pipe warning. Message-ID: <20170411234820.GJ29622@ZenIV.linux.org.uk> References: <20170410195711.GD29622@ZenIV.linux.org.uk> <20170410234830.tmqdhpjtfdveor3c@codemonkey.org.uk> <20170411002215.GE29622@ZenIV.linux.org.uk> <20170411030532.vcam25fz6224ny2h@codemonkey.org.uk> <20170411032839.GF29622@ZenIV.linux.org.uk> <20170411205336.uyz5vfw52twhh6ob@codemonkey.org.uk> <20170411211216.GH29622@ZenIV.linux.org.uk> <20170411222502.ldgahltwvrrxdbbw@codemonkey.org.uk> <20170411232842.GI29622@ZenIV.linux.org.uk> <20170411233437.jmkghan72fb4fclg@codemonkey.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411233437.jmkghan72fb4fclg@codemonkey.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 Content-Length: 1535 Lines: 43 On Tue, Apr 11, 2017 at 07:34:37PM -0400, Dave Jones wrote: > On Wed, Apr 12, 2017 at 12:28:42AM +0100, Al Viro wrote: > > On Tue, Apr 11, 2017 at 06:25:02PM -0400, Dave Jones wrote: > > > > > ffffffff812b3130 T generic_splice_sendpage > > > > > > This one spat out all by itself. > > > > No need to print ->f_op for that one - can be only socket_file_ops. Now, > > the address family of that socket would be interesting... > > Turned out to be.. > > ->splice_write = ffffffff812b2b70 sd->u.file->f_op=ffffffffa02e0980 > $ grep ffffffffa02e0980 /proc/kallsyms > ffffffffa02e0980 r nfs4_file_operations [nfsv4] Lovely... So now we get it not only on splice to socket, but on splice to regular file on NFS as well? That makes lying splice_read() more likely... > > Interesting... How about > > if (res > 0 && pipe == current->splice_pipe) { > > int idx = pipe->curbuf; > > int n = pipe->nrbufs; > > size_t size = 0; > > while (n--) { > > size += pipe->bufs[idx++].len; > > if (idx == pipe->buffers) > > idx = 0; > > } > > WARN_ON(len != res); > > } > > just before the return in default_file_splice_read()? WARN_ON_ONCE, > > perhaps, to avoid cascades... > > Sure, up next. Gimme an hour, it seems to be reproducing fairly quickly > tonight. Makes sense - now it screams on non-empty pipe in the beginning of loop body; originally it was only for _full_ pipe (i.e. for leftovers from several iterations filling the entire thing up), which should've been harder to trigger...