All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Greg Harris <greg.harris@metacarta.com>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: Re: Kernel Panic in xen-blkfront.c:blkif_queue_request under 2.6.28
Date: Mon, 02 Feb 2009 15:30:36 -0800	[thread overview]
Message-ID: <4987821C.9040605@goop.org> (raw)
In-Reply-To: <20090202161425.GK30821@kernel.dk>

Jens Axboe wrote:
> To shed some more light on this, I'd suggest changing that BUG_ON() to
> some code that simply dumps each segment (each bvec in the iterator
> list) from start to finish along with values of
> request->nr_phys_segments and size info.
>   

OK, something like this?

    J

Subject: xen/blkfront: try to track down over-segment BUG_ON in blkfront

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 drivers/block/xen-blkfront.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

===================================================================
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -240,7 +240,10 @@
 
 	ring_req->nr_segments = 0;
 	rq_for_each_segment(bvec, req, iter) {
-		BUG_ON(ring_req->nr_segments == BLKIF_MAX_SEGMENTS_PER_REQUEST);
+		if (WARN_ON(ring_req->nr_segments >=
+			    BLKIF_MAX_SEGMENTS_PER_REQUEST))
+			goto dump_req;
+
 		buffer_mfn = pfn_to_mfn(page_to_pfn(bvec->bv_page));
 		fsect = bvec->bv_offset >> 9;
 		lsect = fsect + (bvec->bv_len >> 9) - 1;
@@ -274,6 +277,25 @@
 	gnttab_free_grant_references(gref_head);
 
 	return 0;
+
+dump_req:
+	{
+		int i;
+
+		printk(KERN_DEBUG "too many segments for ring (%d): "
+		       "req->nr_phys_segments = %d\n",
+		       BLKIF_MAX_SEGMENTS_PER_REQUEST, req->nr_phys_segments);
+
+		i = 0;
+		rq_for_each_segment(bvec, req, iter) {
+			printk(KERN_DEBUG
+			       "  %d: bio page %p pfn %lx off %u len %u\n",
+			       i++, bvec->bv_page, page_to_pfn(bvec->bv_page),
+			       bvec->bv_offset, bvec->bv_len);
+		}
+	}
+
+	return 1;
 }

  parent reply	other threads:[~2009-02-02 23:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11750686.8060601233586380769.JavaMail.root@ouachita>
2009-02-02 14:53 ` Kernel Panic in xen-blkfront.c:blkif_queue_request under 2.6.28 Greg Harris
     [not found]   ` <20090202161425.GK30821@kernel.dk>
2009-02-02 23:30     ` Jeremy Fitzhardinge [this message]
2009-02-03 20:37       ` Greg Harris
2009-02-04 16:50         ` Jeremy Fitzhardinge
     [not found] <24523950.8056631233583862811.JavaMail.root@ouachita>
2009-02-02 14:11 ` Greg Harris
2009-01-30 14:50 Greg Harris
2009-02-02  6:19 ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4987821C.9040605@goop.org \
    --to=jeremy@goop.org \
    --cc=greg.harris@metacarta.com \
    --cc=jens.axboe@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.