From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from arcturus.aphlor.org ([188.246.204.175]:53974 "EHLO arcturus.aphlor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbcJIPMH (ORCPT ); Sun, 9 Oct 2016 11:12:07 -0400 Date: Sun, 9 Oct 2016 11:11:06 -0400 From: Dave Jones To: Al Viro , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Linux Kernel Subject: Re: btrfs_direct_IO oops Message-ID: <20161009151106.damzuhyjpdzq4x2w@codemonkey.org.uk> References: <20161008180806.fmpwtw4vcc7lzd36@codemonkey.org.uk> <20161008182903.GU19539@ZenIV.linux.org.uk> <20161008232008.nouzkd54kiquvpir@codemonkey.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20161008232008.nouzkd54kiquvpir@codemonkey.org.uk> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Sat, Oct 08, 2016 at 07:20:08PM -0400, Dave Jones wrote: > On Sat, Oct 08, 2016 at 07:29:03PM +0100, Al Viro wrote: > > On Sat, Oct 08, 2016 at 02:08:06PM -0400, Dave Jones wrote: > > > That code: matches this dissembly: > > > > > > for (i = seg + 1; i < iter->nr_segs; i++) { > > > > *whoa* > > > > OK, that loop in check_direct_IO() should be done *ONLY* for > > iovec iter - even for a bvec one it's completely bogus, and > > for pipe ones it blows up immediately. > > > > Sorry, I'd missed that bogosity - replace > > if (iov_iter_rw(iter) == WRITE) > > return 0; > > with > > if (iov_iter_rw(iter) != READ || !iter_is_iovec(iter)) > > return 0; > > in there; that should fix the damn thing. > > Yep, seems to do the trick. Have been running the last six hours > without seeing it or anything similar since. Overnight, I did hit another iov related warning.. idx = 0, offset = 0 curbuf = 0, nrbufs = 1, buffers = 16 [ffffffff9fa21100 ffffea00065f6d80 0 4096] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] [ (null) (null) 0 0] WARNING: CPU: 0 PID: 29610 at lib/iov_iter.c:327 sanity+0x102/0x150 CPU: 0 PID: 29610 Comm: trinity-c9 Not tainted 4.8.0-think+ #8 ffffc900007b7ae8 ffffffff9f3e2011 0000000000000000 0000000000000000 ffffffff9fc1e22b ffffffff9f3fa2f2 ffffc900007b7b28 ffffffff9f08b010 0000014734c3d60f ffffffff9fc1e22b 0000000000000147 0000000000000010 Call Trace: [] dump_stack+0x6c/0x9b [] ? sanity+0x102/0x150 [] __warn+0x110/0x130 [] warn_slowpath_null+0x2c/0x40 [] sanity+0x102/0x150 [] copy_page_to_iter+0x2be/0x480 [] ? pagecache_get_page+0xba/0x4f0 [] generic_file_read_iter+0x245/0xd30 [] generic_file_splice_read+0xfd/0x230 [] ? pipe_to_user+0x40/0x40 [] do_splice_to+0x98/0xd0 [] splice_direct_to_actor+0xd4/0x2c0 [] ? generic_pipe_buf_nosteal+0x10/0x10 [] do_splice_direct+0xc5/0x110 [] do_sendfile+0x242/0x470 [] SyS_sendfile64+0x7d/0xf0 [] do_syscall_64+0x7f/0x200 [] entry_SYSCALL64_slow_path+0x25/0x25 ---[ end trace 2c7bd411d4aa0491 ]---