Re: 2.5.1-pre2 compile error in ide-scsi.o ide-scsi.c

Jens Axboe
2001-11-28T14:38:49Z

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

On Wed, Nov 28 2001, Jens Axboe wrote:
> On Wed, Nov 28 2001, Sebastian Dröge wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Am Mittwoch, 28. November 2001 14:58 schrieben Sie:
> > > On Wed, Nov 28 2001, Sebastian Dröge wrote:
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA1
> > > >
> > > > Hi Jens,
> > > > your patch doesn't work for ide-scsi
> > > > I get this oops when trying to mount a CD:
> > >
> > > [oops in sr_scatter_pad]
> > >
> > > Hmm ok, and 2.5.1-pre1 works for you right?
> >
> > Yes it works very well
>
> Ok, thanks for confirming that. Going to take a look at it now.

Does this work for you? Apply on top of what you already have.

--
Jens Axboe

[-- Attachment #2: sr-sg-1 --]
[-- Type: text/plain, Size: 1096 bytes --]

--- /opt/kernel/linux-2.5.1-pre2/drivers/scsi/sr.c Wed Nov 28 09:13:59 2001
+++ drivers/scsi/sr.c Wed Nov 28 15:33:25 2001
@@ -326,11 +326,14 @@
}
if (old_sg) {
memcpy(sg + i, old_sg, SCpnt->use_sg * sizeof(struct scatterlist));
- memcpy(bbpnt + i, old_bbpnt, SCpnt->use_sg * sizeof(void *));
+ if (old_bbpnt)
+ memcpy(bbpnt + i, old_bbpnt, SCpnt->use_sg * sizeof(void *));
scsi_free(old_sg, (((SCpnt->use_sg * sizeof(struct scatterlist)) +
(SCpnt->use_sg * sizeof(void *))) + 511) & ~511);
} else {
- sg[i].address = SCpnt->request_buffer;
+ sg[i].address = NULL;
+ sg[i].page = virt_to_page(SCpnt->request_buffer);
+ sg[i].offset = (unsigned long) SCpnt->request_buffer&~PAGE_MASK;
sg[i].length = SCpnt->request_bufflen;
}

@@ -340,7 +343,9 @@
SCpnt->use_sg += i;

if (bsize) {
- sg[SCpnt->use_sg].address = back;
+ sg[SCpnt->use_sg].address = NULL;
+ sg[SCpnt->use_sg].page = virt_to_page(back);
+ sg[SCpnt->use_sg].offset = (unsigned long) back & ~PAGE_MASK;
bbpnt[SCpnt->use_sg] = back;
sg[SCpnt->use_sg].length = bsize;
SCpnt->use_sg++;