Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp24630imp; Tue, 19 Feb 2019 17:18:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IZkRxQ5piCaLpVB0hFw93s45NW/PBaC6AiKTCR53/zzefNXcAE9xVaKbLTbDV9XcQAU0Mw6 X-Received: by 2002:a17:902:7614:: with SMTP id k20mr17658935pll.298.1550625508932; Tue, 19 Feb 2019 17:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550625508; cv=none; d=google.com; s=arc-20160816; b=eGXVkF4LWd+fESiVpRS0E/wTXEJSUdN7KmmS5Y9bG5wXx+op5LJ7A1eyjfpEDJRHQD RNhUqru4/njk0gf8bNzTsROdxBRb8beDtE7Q5U3hhHcASVNfUd3aFCX3UL1LC7uLaPXs EQvOlZ2gNQ+NkbTWv7vb9kSb1lfm02qmVhQ1LOOkLBiU4fcW4YFsEVhfVQIlkMZmoZgC bYVuhTQa0qK/ovG1UGX6ly7Phtlus40aFWG+z2EMpaNGybJIQackgv8zDSZqh0ZZnJD3 iXK8lG3G0+c9L+xL6Oc3pYlStk8LbGhvZM8u0S0V/UV++Y//YQrdQNj0pGLCfAN9zqBw RfRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cxz8PSCizWLyu3nFHbrT9aZjAmozVtiHFlv4/k/JLV8=; b=pJuEFYamVQw111tQzK+CNDXDPPYccI2UQljbJRXcUmWJUoKZQh+oa0EHW5HCTjyMkt zGTE8nRW7+Z1qtuIRpoL82/qAldhDgC9r4yBiK0alrC9GOJYpvye5FR/qlEwTpDdgekf vw75+kfN2VZ5kQhA8qEPLn4Ztyb5XDtm03G0Kunomb3qras/jUiUD3kCZI00wd/c70y3 A7TpNY9NMPBg/PnWJhwsvHG8WnSCiGL9vVq8odppykVQaCfQ0sazVqZiXheOKPtr75kN 32+GR3wrBweOBYPo7J2PvNAYfqDpJfplTrA6UAl9iCJQyHJX3eAgIWUocBiskDy6iZr7 4+2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w190si12382676pgd.105.2019.02.19.17.18.14; Tue, 19 Feb 2019 17:18:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730199AbfBTBRu (ORCPT + 99 others); Tue, 19 Feb 2019 20:17:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbfBTBRt (ORCPT ); Tue, 19 Feb 2019 20:17:49 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14EB83D978; Wed, 20 Feb 2019 01:17:48 +0000 (UTC) Received: from ming.t460p (ovpn-8-26.pek2.redhat.com [10.72.8.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86BC461B93; Wed, 20 Feb 2019 01:17:25 +0000 (UTC) Date: Wed, 20 Feb 2019 09:17:20 +0800 From: Ming Lei To: Bart Van Assche Cc: Jens Axboe , Mike Snitzer , linux-mm@kvack.org, dm-devel@redhat.com, Christoph Hellwig , Sagi Grimberg , "Darrick J . Wong" , Omar Sandoval , cluster-devel@redhat.com, linux-ext4@vger.kernel.org, Kent Overstreet , Boaz Harrosh , Gao Xiang , Coly Li , linux-raid@vger.kernel.org, Bob Peterson , linux-bcache@vger.kernel.org, Alexander Viro , Dave Chinner , David Sterba , linux-block@vger.kernel.org, Theodore Ts'o , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [dm-devel] [PATCH V15 00/18] block: support multi-page bvec Message-ID: <20190220011719.GA13035@ming.t460p> References: <20190215111324.30129-1-ming.lei@redhat.com> <1550250855.31902.102.camel@acm.org> <20190217131128.GB7296@ming.t460p> <1550593699.31902.115.camel@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550593699.31902.115.camel@acm.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 20 Feb 2019 01:17:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 19, 2019 at 08:28:19AM -0800, Bart Van Assche wrote: > On Sun, 2019-02-17 at 21:11 +0800, Ming Lei wrote: > > The following patch should fix this issue: > > > > > > diff --git a/block/blk-merge.c b/block/blk-merge.c > > index bed065904677..066b66430523 100644 > > --- a/block/blk-merge.c > > +++ b/block/blk-merge.c > > @@ -363,13 +363,15 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, > > struct bio_vec bv, bvprv = { NULL }; > > int prev = 0; > > unsigned int seg_size, nr_phys_segs; > > - unsigned front_seg_size = bio->bi_seg_front_size; > > + unsigned front_seg_size; > > struct bio *fbio, *bbio; > > struct bvec_iter iter; > > > > if (!bio) > > return 0; > > > > + front_seg_size = bio->bi_seg_front_size; > > + > > switch (bio_op(bio)) { > > case REQ_OP_DISCARD: > > case REQ_OP_SECURE_ERASE: > > Hi Ming, > > With this patch applied test nvmeof-mp/002 fails as follows: > > [ 694.700400] kernel BUG at lib/sg_pool.c:103! > [ 694.705932] invalid opcode: 0000 [#1] PREEMPT SMP KASAN > [ 694.708297] CPU: 2 PID: 349 Comm: kworker/2:1H Tainted: G B 5.0.0-rc6-dbg+ #2 > [ 694.711730] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 > [ 694.715113] Workqueue: kblockd blk_mq_run_work_fn > [ 694.716894] RIP: 0010:sg_alloc_table_chained+0xe5/0xf0 > [ 694.758222] Call Trace: > [ 694.759645] nvme_rdma_queue_rq+0x2aa/0xcc0 [nvme_rdma] > [ 694.764915] blk_mq_try_issue_directly+0x2a5/0x4b0 > [ 694.771779] blk_insert_cloned_request+0x11e/0x1c0 > [ 694.778417] dm_mq_queue_rq+0x3d1/0x770 > [ 694.793400] blk_mq_dispatch_rq_list+0x5fc/0xb10 > [ 694.798386] blk_mq_sched_dispatch_requests+0x2f7/0x300 > [ 694.803180] __blk_mq_run_hw_queue+0xd6/0x180 > [ 694.808933] blk_mq_run_work_fn+0x27/0x30 > [ 694.810315] process_one_work+0x4f1/0xa40 > [ 694.813178] worker_thread+0x67/0x5b0 > [ 694.814487] kthread+0x1cf/0x1f0 > [ 694.819134] ret_from_fork+0x24/0x30 > > The code in sg_pool.c that triggers the BUG() statement is as follows: > > int sg_alloc_table_chained(struct sg_table *table, int nents, > struct scatterlist *first_chunk) > { > int ret; > > BUG_ON(!nents); > [ ... ] > > Bart. I can reproduce this issue("kernel BUG at lib/sg_pool.c:103") without mp-bvec patches, so looks it isn't the fault of this patchset. Thanks, Ming