Re: Re: kernel BUG at drivers/block/virtio_blk.c:172

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 10, 2014 at 7:59 PM, Lukáš Czerner <lczerner@xxxxxxxxxx> wrote:
>
> Hi,
>
> so I encountered it again on 3.17.0-rc4. This output is from the
> run with your patch.
>
> I am using libvirt (virt-manager) to configure and run the virtual
> machine, but looking at the xml, I do not think it's passing
> 'scsi=off' at all.
>
> Btw, that xfs file system is a root file system.
>
>
> [    3.667553] blk_recount_segments: 1-0-1 vcnt-0 segs-128
> [    3.668692] blk_recount_segments: 1-0-1 vcnt-0 segs-128
> [    3.669897] blk_recount_segments: 1-0-1 vcnt-0 segs-128
> [    3.671083] blk_recount_segments: 1-0-1 vcnt-0 segs-128

Hamm, I should have used bi_phys_segments to decide if
merge is needed, and attached patch should fix the problem.


Thanks,
Ming Lei
From bcb4f411c23e114f7c77c0858d7f78f50fda68e9 Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@xxxxxxxxx>
Date: Mon, 10 Nov 2014 20:10:24 +0800
Subject: [PATCH] block/blk-merge: fix blk_recount_segments

bio->bi_phys_segments should be used for deciding if merge
is needed instead of bio->vcnt which isn't valid for cloned bio.

Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
---
 block/blk-merge.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index b3ac40a..3387fd6 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -99,7 +99,7 @@ void blk_recount_segments(struct request_queue *q, struct bio *bio)
 {
 	bool no_sg_merge = !!test_bit(QUEUE_FLAG_NO_SG_MERGE,
 			&q->queue_flags);
-	bool merge_not_need = bio->bi_vcnt < queue_max_segments(q);
+	bool merge_not_need = bio->bi_phys_segments < queue_max_segments(q);
 
 	if (no_sg_merge && !bio_flagged(bio, BIO_CLONED) &&
 			merge_not_need)
-- 
1.7.9.5

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux