Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbdDLRH2 (ORCPT ); Wed, 12 Apr 2017 13:07:28 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:39954 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753377AbdDLRHZ (ORCPT ); Wed, 12 Apr 2017 13:07:25 -0400 Date: Wed, 12 Apr 2017 18:07:23 +0100 From: Al Viro To: Dave Jones , Linux Kernel Subject: Re: iov_iter_pipe warning. Message-ID: <20170412170723.GQ29622@ZenIV.linux.org.uk> References: <20170411235641.GL29622@ZenIV.linux.org.uk> <20170412000607.ob4cjv7vof3f64uu@codemonkey.org.uk> <20170412001746.GM29622@ZenIV.linux.org.uk> <20170412005853.vqyuo6722tmthn5u@codemonkey.org.uk> <20170412011532.GN29622@ZenIV.linux.org.uk> <20170412022911.nhefjqlnyrk3n7rr@codemonkey.org.uk> <20170412025842.GO29622@ZenIV.linux.org.uk> <20170412143519.4hh36l3egozgdrll@codemonkey.org.uk> <20170412152600.GP29622@ZenIV.linux.org.uk> <20170412162709.bn5qfk4seues3yos@codemonkey.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170412162709.bn5qfk4seues3yos@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: 2123 Lines: 64 On Wed, Apr 12, 2017 at 12:27:09PM -0400, Dave Jones wrote: > [ 1010.317696] asked to read 2097152, claims to have read 7025 > [ 1010.329471] actual size of data in pipe 65536 > [ 1010.341162] [0:4096 > [ 1010.353232] ,1:4096 > [ 1010.364402] ,2:4096 > [ 1010.375608] ,3:4096 > [ 1010.386346] ,4:4096 > [ 1010.397027] ,5:4096 > [ 1010.407611] ,6:4096 > [ 1010.418010] ,7:4096 > [ 1010.428533] ,8:4096 > [ 1010.438885] ,9:4096 > [ 1010.449269] ,10:4096 > [ 1010.459462] ,11:4096 > [ 1010.469519] ,12:4096 > [ 1010.479326] ,13:4096 > [ 1010.489093] ,14:4096 > [ 1010.498711] ,15:4096 > [ 1010.508217] ] > [ 1010.517570] f_op: ffffffffa0242980, f_flags: 311298, pos: 11/7036, size: 7036 OK, I see what's going on. Could you check if the following stops the warnings? It's not the final variant of fix - there's no need to copy the entire iov_iter, it's just that the primitive needed to deal with that in cleaner way is still not in mainline - davem has pulled it into net.git, but that was after the latest pull from net.git into mainline. For now it should at least tell whether there's something else going on, though: diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index aab32fc3d6a8..d1633753a1a8 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -568,6 +568,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter) struct nfs_lock_context *l_ctx; ssize_t result = -EINVAL; size_t count = iov_iter_count(iter); + struct iov_iter data; nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n", @@ -600,14 +601,17 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter) nfs_start_io_direct(inode); NFS_I(inode)->read_io += count; - result = nfs_direct_read_schedule_iovec(dreq, iter, iocb->ki_pos); + data = *iter; + result = nfs_direct_read_schedule_iovec(dreq, &data, iocb->ki_pos); nfs_end_io_direct(inode); if (!result) { result = nfs_direct_wait(dreq); - if (result > 0) + if (result > 0) { + iov_iter_advance(iter, result); iocb->ki_pos += result; + } } out_release: