Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp232139ybl; Tue, 7 Jan 2020 18:00:31 -0800 (PST) X-Google-Smtp-Source: APXvYqy+GesK/EnWlyVYAZ9cTZl81PpkcYAsEb3gaGKG9hy7MJFqIcQCBEmCHY+4KVngubT9mZJM X-Received: by 2002:a05:6830:147:: with SMTP id j7mr2526216otp.44.1578448831474; Tue, 07 Jan 2020 18:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578448831; cv=none; d=google.com; s=arc-20160816; b=WKzfpJXwofgsoTQnuYLW35QabzG+5GBmdEhYOoFD4vyu2jEQQCEgARNiSGci8g/9gC wGFUR0jjfSn+JAT+HavRRsYPezMaOVYymt4qtRKbRn4QQ7h2kGA7gD1LPjyd1eQZNnOu dlzzK9xSbSRbOSrBGHNumacs8REKLWNOnkxNUuEO4lRKWRX1B2ZjkyLMaqtLvd7wfzp8 avHYr2pIq62e0/jSzAgnXkVGT1lAkIkvOe9GwfKKqliCHJAeXhrLnnqwaq6NdHIA6d+4 P1gLkucaBtfkytgGXjksuA2d8MVYuzsDdHsQLg1EAOG/hMU2PpmkliFSWJzT4M9oEdWr At9A== 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:dkim-signature; bh=LjLwLmpSUbg8u0AztC/Qpmmv1mRzMlVQIb/3GK56guo=; b=BXj4vy35NupYzxlqnNe+iTajRQgrhKYuX8vYaA9ZcfnE454Gfvn7dJayRTI44v0sT7 IClZHWsNjSmoXwjXm588Xm6C3e2KkCqonBIe5yLCeo0JJ7YH3ldYYHhz8xqOViSpWKCx 07Pi8rS8DYz60/9v7g5TOSfDLOuFV4mRquag0Wk81CnIvWRWDnJ82R9CNmBEqAQ7dV/j 6ksPKfKXgpqbbVJAxGonnnOJcc+PDm8IutYWZU3IFS/9FoAJ4jEj1Xr+ROdcqolhdB2J MQxpalQBrzdzMBZut8tfFZPNF52NrbHNuPhK+Ec6S3irnFKMH47imxEwIQtpa9I8mEJp XSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IEG0V6RT; 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=pass (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 u21si948138oic.263.2020.01.07.18.00.20; Tue, 07 Jan 2020 18:00:31 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IEG0V6RT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgAHB7j (ORCPT + 99 others); Tue, 7 Jan 2020 20:59:39 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27933 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726142AbgAHB7i (ORCPT ); Tue, 7 Jan 2020 20:59:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578448778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LjLwLmpSUbg8u0AztC/Qpmmv1mRzMlVQIb/3GK56guo=; b=IEG0V6RTjdwgl7ZUrdFxmxpGScBrAHO4ptp83xb7jD7K/GFNTSYBwlvtNxSjlcu61TgjmJ o6CjrZQEUXDVxpuq+xLvZ/U8XOnXMCzLmhnWtx/00jsxRhlf1oifJFUGoWAE22a4CZrDxQ jeHNvaVQhuANXOov9OhEauaypRIw2rE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-cnd4LJBYMxmd5ueqmLhsgQ-1; Tue, 07 Jan 2020 20:59:26 -0500 X-MC-Unique: cnd4LJBYMxmd5ueqmLhsgQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7970B801E76; Wed, 8 Jan 2020 01:59:25 +0000 (UTC) Received: from ming.t460p (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 554A260CD1; Wed, 8 Jan 2020 01:59:19 +0000 (UTC) Date: Wed, 8 Jan 2020 09:59:15 +0800 From: Ming Lei To: Jens Axboe Cc: Guenter Roeck , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Mason Subject: Re: [PATCH] block: fix splitting segments Message-ID: <20200108015915.GA28075@ming.t460p> References: <20191229023230.28940-1-ming.lei@redhat.com> <20200107124708.GA20285@roeck-us.net> <20200107152339.GA23622@ming.t460p> <20200107181145.GA22076@roeck-us.net> <20200107223035.GA7505@ming.t460p> <25ce5140-ee29-c32c-7f5e-b8c6da5c7e90@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25ce5140-ee29-c32c-7f5e-b8c6da5c7e90@kernel.dk> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2020 at 03:32:58PM -0700, Jens Axboe wrote: > On 1/7/20 3:30 PM, Ming Lei wrote: > > On Tue, Jan 07, 2020 at 10:11:45AM -0800, Guenter Roeck wrote: > >> On Tue, Jan 07, 2020 at 11:23:39PM +0800, Ming Lei wrote: > >>> On Tue, Jan 07, 2020 at 04:47:08AM -0800, Guenter Roeck wrote: > >>>> Hi, > >>>> > >>>> On Sun, Dec 29, 2019 at 10:32:30AM +0800, Ming Lei wrote: > >>>>> There are two issues in get_max_segment_size(): > >>>>> > >>>>> 1) the default segment boudary mask is bypassed, and some devices still > >>>>> require segment to not cross the default 4G boundary > >>>>> > >>>>> 2) the segment start address isn't taken into account when checking > >>>>> segment boundary limit > >>>>> > >>>>> Fixes the two issues. > >>>>> > >>>>> Fixes: dcebd755926b ("block: use bio_for_each_bvec() to compute multi-page bvec count") > >>>>> Signed-off-by: Ming Lei > >>>> > >>>> This patch, pushed into mainline as "block: fix splitting segments on > >>>> boundary masks", results in the following crash when booting 'versatilepb' > >>>> in qemu from disk. Bisect log is attached. Detailed log is at > >>>> https://kerneltests.org/builders/qemu-arm-master/builds/1410/steps/qemubuildcommand/logs/stdio > >>>> > >>>> Guenter > >>>> > >>>> --- > >>>> Crash: > >>>> > >>>> kernel BUG at block/bio.c:1885! > >>>> Internal error: Oops - BUG: 0 [#1] ARM > >>> > >>> Please apply the following debug patch, and post the log. > >>> > >> > >> Here you are: > >> > >> max_sectors 2560 max_segs 96 max_seg_size 65536 mask ffffffff > >> c738da80: 8c80/0 2416 28672, 0 > >> total sectors 56 > >> > >> (I replaced %p with %px). > >> > > > > Please try the following patch and see if it makes a difference. > > If not, replace trace_printk with printk in previous debug patch, > > and apply the debug patch only & post the log. > > If it is a 32-bit issue, then we should use a 64-bit type to make > this nicer than ULL. But it seems reasonable that it could be! oops, just saw this email after sending out the patch. Do you need V2 to change ULL to u64? Thanks, Ming