From patchwork Mon Oct 10 15:55:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 9369677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDA946048F for ; Mon, 10 Oct 2016 15:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE4062932E for ; Mon, 10 Oct 2016 15:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2A2F2935A; Mon, 10 Oct 2016 15:55:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 703D62932E for ; Mon, 10 Oct 2016 15:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812AbcJJPzK (ORCPT ); Mon, 10 Oct 2016 11:55:10 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:49960 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbcJJPzJ (ORCPT ); Mon, 10 Oct 2016 11:55:09 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1btcut-0006Sm-Lk; Mon, 10 Oct 2016 15:55:03 +0000 Date: Mon, 10 Oct 2016 16:55:03 +0100 From: Al Viro To: Dave Jones , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Linux Kernel Subject: Re: btrfs_direct_IO oops Message-ID: <20161010155503.GZ19539@ZenIV.linux.org.uk> References: <20161008180806.fmpwtw4vcc7lzd36@codemonkey.org.uk> <20161008182903.GU19539@ZenIV.linux.org.uk> <20161008232008.nouzkd54kiquvpir@codemonkey.org.uk> <20161009151106.damzuhyjpdzq4x2w@codemonkey.org.uk> <20161010034356.GY19539@ZenIV.linux.org.uk> <20161010131122.cjmoof6yblwl7tak@codemonkey.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161010131122.cjmoof6yblwl7tak@codemonkey.org.uk> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Oct 10, 2016 at 09:11:22AM -0400, Dave Jones wrote: > My compiler choked on that, but I fixed it up. The printk didn't > trigger though.. > > idx = 0, offset = 0 > curbuf = 0, nrbufs = 1, buffers = 16 > [ffffffffb9a21100 ffffea00126019c0 0 4096] > [ (null) ffffea0013746440 0 0] > [ (null) ffffea00132956c0 0 0] > [ (null) ffffea0013295700 0 0] > [ (null) ffffea0013295740 0 0] > [ (null) ffffea0013295780 0 0] > [ (null) ffffea00132957c0 0 0] > [ (null) ffffea0013595c00 0 0] > [ (null) ffffea0012b1b6c0 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] > ------------[ cut here ]------------ > WARNING: CPU: 1 PID: 13581 at lib/iov_iter.c:327 sanity+0x102/0x150 > CPU: 1 PID: 13581 Comm: trinity-c17 Not tainted 4.8.0-think+ #9 > ffffc90000963ae8 > ffffffffb93e22d1 > 0000000000000000 > 0000000000000000 > > ffffffffb9c1e1cb > ffffffffb93fa5b2 > ffffc90000963b28 > ffffffffb908b010 > > 00000147d43c0e7f > ffffffffb9c1e1cb > 0000000000000147 > 0000000000000010 What are these from? Confused... > Call Trace: [via splice_direct_to_actor()] Hmmm... I think I see it. Could you try the following (on top of debugging in lib/iov_iter.c) and see if anything triggers? --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index bfc2aa7..b63d8c5 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -319,7 +319,7 @@ xfs_file_dio_aio_read( data = *to; ret = __blockdev_direct_IO(iocb, inode, target->bt_bdev, &data, xfs_get_blocks_direct, NULL, NULL, 0); - if (ret > 0) { + if (ret >= 0) { iocb->ki_pos += ret; iov_iter_advance(to, ret); } diff --git a/mm/filemap.c b/mm/filemap.c index 68f1813..88e5ddd 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1935,7 +1935,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) file_accessed(file); retval = mapping->a_ops->direct_IO(iocb, &data); - if (retval > 0) { + if (retval >= 0) { iocb->ki_pos += retval; iov_iter_advance(iter, retval); }