From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEC73612E1 for ; Fri, 9 Jan 2026 14:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767969659; cv=none; b=N72QG/kkNhjI5PDqhexw9VX9fipnMLUJ/GNNnmBn13DjCYMbvGQC5piMk2kkJ6m2m05gPhPrcywq49+19QyaekDN7WDqy0E3FwqeNWjG8OGuXyLSE3BY+H6Yqi45dorBArw6zw+FgNBat8u5gU1lM+B+pk8dLrYXXzLGB3q86Tc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767969659; c=relaxed/simple; bh=5jlOfYj+ObCR52PVgF13Z89GSOj3yoygabUG550Aazg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KjN43cq4pYVgbEmqA0WMwuSpl3ly1O0HJN3RX6btpDN47UPI9zd6hI30kDMaZKpY8SL6oKLxQrv0dqllAvNeamM1HxphqA6srS0Fe3M7szqoXE15E/E2W3B4OpGuvWtiWF5lsWjEvx8yXro4sTF4ulcbdpsY9/V6Ngz8k4aoKOs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cz5Tjouc; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cz5Tjouc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767969657; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4WZOrllwhvLAdn1gTsOABlv26CL05TG42u6HT7EiAos=; b=cz5TjoucAS4pH2UMEQYWXXfqwOKDg0vtps8eRm9cFGp9dH0mGo9ynn7DnteP/Ry/j/bFwf vujGs4bfmKjk8BoJYfTnkear2TyD33JD4QrZb7zM7A/Uignj+EqABD5tqPyL3p1l+f6dok SRll27t1adZDzTf676r0Iu9wt8YT9yI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-e6P9twM5NRK4iZ5JdkpsHA-1; Fri, 09 Jan 2026 09:40:51 -0500 X-MC-Unique: e6P9twM5NRK4iZ5JdkpsHA-1 X-Mimecast-MFC-AGG-ID: e6P9twM5NRK4iZ5JdkpsHA_1767969647 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B38721956053; Fri, 9 Jan 2026 14:40:47 +0000 (UTC) Received: from fedora (unknown [10.72.116.172]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A7AD30002D1; Fri, 9 Jan 2026 14:40:40 +0000 (UTC) Date: Fri, 9 Jan 2026 22:40:29 +0800 From: Ming Lei To: Venkat Rao Bagalkote Cc: Christoph Hellwig , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Jens Axboe , James.Bottomley@hansenpartnership.com, leonro@nvidia.com, kch@nvidia.com, LKML , Madhavan Srinivasan , riteshh@linux.ibm.com, ojaswin@linux.ibm.com Subject: Re: [next-20260108]kernel BUG at drivers/scsi/scsi_lib.c:1173! Message-ID: References: <9687cf2b-1f32-44e1-b58d-2492dc6e7185@linux.ibm.com> <7382f235-3e42-4b77-b18d-c38661816301@linux.ibm.com> <4c85df85-58f7-4e44-8201-2f0562f93439@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4c85df85-58f7-4e44-8201-2f0562f93439@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On Fri, Jan 09, 2026 at 07:53:00PM +0530, Venkat Rao Bagalkote wrote: > > On 09/01/26 7:35 pm, Ming Lei wrote: > > On Fri, Jan 09, 2026 at 07:26:01PM +0530, Venkat Rao Bagalkote wrote: > > > On 09/01/26 6:28 pm, Ming Lei wrote: > > > > On Fri, Jan 09, 2026 at 05:51:15PM +0530, Venkat Rao Bagalkote wrote: > > > > > On 09/01/26 5:25 pm, Ming Lei wrote: > > > > > > On Fri, Jan 09, 2026 at 05:14:36PM +0530, Venkat Rao Bagalkote wrote: > > > > > > > On 09/01/26 12:19 pm, Ming Lei wrote: > > > > > > > > On Thu, Jan 08, 2026 at 09:56:39PM -0800, Christoph Hellwig wrote: > > > > > > > > > I've seen the same when running xfstests on xfs, and bisected it to: > > > > > > > > > > > > > > > > > > commit ee623c892aa59003fca173de0041abc2ccc2c72d > > > > > > > > > Author: Ming Lei > > > > > > > > > Date: Wed Dec 31 11:00:55 2025 +0800 > > > > > > > > > > > > > > > > > > block: use bvec iterator helper for bio_may_need_split() > > > > > > > > > > > > > > > > > Hi Christoph and Venkat Rao Bagalkote, > > > > > > > > > > > > > > > > Unfortunately I can't duplicate the issue in my environment, can you test > > > > > > > > the following patch? > > > > > > > > > > > > > > > > diff --git a/block/blk.h b/block/blk.h > > > > > > > > index 98f4dfd4ec75..980eef1f5690 100644 > > > > > > > > --- a/block/blk.h > > > > > > > > +++ b/block/blk.h > > > > > > > > @@ -380,7 +380,7 @@ static inline bool bio_may_need_split(struct bio *bio, > > > > > > > > return true; > > > > > > > > bv = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); > > > > > > > > - if (bio->bi_iter.bi_size > bv->bv_len) > > > > > > > > + if (bio->bi_iter.bi_size > bv->bv_len - bio->bi_iter.bi_bvec_done) > > > > > > > > return true; > > > > > > > > return bv->bv_len + bv->bv_offset > lim->max_fast_segment_size; > > > > > > > > } > > > > > > > Hello Ming, > > > > > > > > > > > > > > > > > > > > > This is not helping. I am hitting this issue, during kernel build itself. > > > > > > Can you confirm if it can fix the blktests ext4/056 first? > > > > > > > > > > > > If kernel building is running over new patched kernel, please provide the > > > > > > dmesg log. And if it is reproduciable, can you confirm if it can be fixed > > > > > > by reverting ee623c892aa59003 (block: use bvec iterator helper for bio_may_need_split())? > > > > > Unfortunately, even with revert, build fails. > > > > > > > > > > > > > > > > > > > > commit c64b2ee9cddcb31546c8622ef018d344544a9388 (HEAD) > > > > > Author: Super User > > > > > Date:   Fri Jan 9 06:51:19 2026 -0600 > > > > > > > > > >     Revert "block: use bvec iterator helper for bio_may_need_split()" > > > > > > > > > >     This reverts commit ee623c892aa59003fca173de0041abc2ccc2c72d. > > > > OK, then your issue isn't related with the above change. > > > > > > > > Can you reproduce & collect dmesg log with the bad sg/rq/bio/bvec info by > > > > applying the attached debug patch? > > > > > > > > Also if possible, please collect your scsi queue's limit info before > > > > reproducing the issue: > > > > > > > > (cd /sys/block/$SD/queue && find . -type f -exec grep -aH . {} \;) > > > Hello Ming, > > > > > > After applying the patch shared via attachment also, I see build failure. > > > > > > I have attached the kernel config file. > > > > > > > > > git diff > > > diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c > > > index 752060d7261c..33c1b6a0a738 100644 > > > --- a/block/blk-mq-dma.c > > > +++ b/block/blk-mq-dma.c > > > @@ -4,8 +4,75 @@ > > >   */ > > >  #include > > >  #include > > > +#include > > >  #include "blk.h" > > Hi Venkat, > > > > Thanks for your test. > > > > But you didn't apply the whole debug patch in the following link: > > > > https://lore.kernel.org/linux-block/aWD7j3NR_m6EyZv1@fedora/ > > > > otherwise something like "=== __blk_rq_map_sg DEBUG DUMP ===" will be > > dumped in dmesg log. > > > > > make -j 48 -s && make modules_install && make install > > > [ 5625.770436] ------------[ cut here ]------------ > > > [ 5625.770476] WARNING: block/blk-mq-dma.c:309 at > > If the whole debug patch is applied correctly, the above line number should > > have become 378 instead of original 309. > > > > Please re-apply the debug patch & reproduce again. > > > > Hello Ming, > > > Apologies for back and forth. But I did apply the whole patch. Below is the > git diff from my machine. Let me know, if I am missing anything. OK, the patch is correct. But you need to boot with one good kernel(such as, distribution shipped kernel) first for building new test kernel against -next tree with this patch. After this new test kernel is built & installed & reboot, you can start your kernel build workload, then the issue will be triggered, and the log is collected. When the issue is triggered, `WARNING: block/blk-mq-dma.c:378 ` should be shown in dmesg log, which signals you are running the test kernel with the debug patch for collecting log. Please let me know if anything is clear. Thanks, Ming