Re: oops with 2.5.1-pre3 in ide-scsi module

From: Jens Axboe (axboe@suse.de)
Date: Thu Nov 29 2001 - 13:47:52 EST


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 30 2001 - 21:00:35 EST