The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Dirk Pritsch <dirk@enterprise.in-berlin.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: oops with 2.5.1-pre3 in ide-scsi module
Date: Thu, 29 Nov 2001 19:47:52 +0100	[thread overview]
Message-ID: <20011129194752.T10601@suse.de> (raw)
In-Reply-To: <20011129191938.A1402@Enterprise.in-berlin.de> <20011129193956.S10601@suse.de>
In-Reply-To: <20011129193956.S10601@suse.de>

On Thu, Nov 29 2001, Jens Axboe wrote:
> Hmm, I bet the problem is not really bio but the fact that someone is
> still sending down a scatterlist with ->address set instead of
> ->page/offset.
> 
> Let me hack a quick fix up for you to test... 2 minutes.

Please try this, and check for oops and "jens was right" in dmesg. Let
me know how it goes, thanks.

--- /opt/kernel/linux-2.5.1-pre3/drivers/scsi/ide-scsi.c	Thu Nov 29 06:07:21 2001
+++ drivers/scsi/ide-scsi.c	Thu Nov 29 13:44:04 2001
@@ -708,16 +708,30 @@
 		printk ("ide-scsi: %s: building DMA table, %d segments, %dkB total\n", drive->name, segments, pc->request_transfer >> 10);
 #endif /* IDESCSI_DEBUG_LOG */
 		while (segments--) {
-			bh->bi_io_vec[0].bv_page = sg->page;
+			struct page *page = sg->page;
+			int offset = sg->offset;
+			static int foo;
+
+			if (!page) {
+				BUG_ON(!sg->address);
+				if (!foo) {
+					printk("jens was right\n");
+					foo = 1;
+				}
+				page = virt_to_page(sg->address);
+				offset = (unsigned long) sg->address & ~PAGE_MASK;
+			}
+				
+			bh->bi_io_vec[0].bv_page = page;
 			bh->bi_io_vec[0].bv_len = sg->length;
-			bh->bi_io_vec[0].bv_offset = sg->offset;
+			bh->bi_io_vec[0].bv_offset = offset;
 			bh->bi_size = sg->length;
 			bh = bh->bi_next;
 			/*
 			 * just until scsi_merge is fixed up...
 			 */
-			BUG_ON(PageHighMem(sg->page));
-			sg->address = page_address(sg->page) + sg->offset;
+			BUG_ON(PageHighMem(page));
+			sg->address = page_address(page) + offset;
 			sg++;
 		}
 	} else {

-- 
Jens Axboe


  reply	other threads:[~2001-11-29 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-29 18:19 oops with 2.5.1-pre3 in ide-scsi module Dirk Pritsch
2001-11-29 18:38 ` Slo Mo Snail
2001-11-29 18:39 ` Jens Axboe
2001-11-29 18:47   ` Jens Axboe [this message]
2001-11-29 19:36     ` Dirk Pritsch
     [not found] ` <200111291838.fATIcHNO029528@einhorn.in-berlin.de>
2001-11-29 18:45   ` Dirk Pritsch
2001-11-29 19:00     ` Sebastian Dröge

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=20011129194752.T10601@suse.de \
    --to=axboe@suse.de \
    --cc=dirk@enterprise.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox