Skip to contentSkip to conversation

SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)

DISCUSSION Dan Maas 2 participants 3 messages Oct 30, 2001 – Oct 31, 2001 1 message not in the archive

lore
Share & tools
lore

Dan Maas

author
#1 lore raw
In reply to a message not in the archive
Quoted 3 lines

Can people try out this patch? I believe this will fix the bug.
+ tb->sg[0].page = NULL;
if (tb->sg[segs].address == NULL) {

For the sake of making this clear to other kernel hackers (I got bitten by it too) - starting with 2.4.13 you must zero out the fields of struct scatterlist that you are not using. i.e. it is no longer sufficient to simply set sg.address and sg.length, because junk might still be present in the new sg.page field, and pci_map_*() will BUG() if both sg.address and sg.page are non-zero.

Regards,
Dan

#2 lore raw
In reply to a message not in the archive
Quoted 10 lines · Dan Maas
Quoted 3 lines

Can people try out this patch? I believe this will fix the bug.
+ tb->sg[0].page = NULL;
if (tb->sg[segs].address == NULL) {

For the sake of making this clear to other kernel hackers (I got bitten by it too) - starting with 2.4.13 you must zero out the fields of struct scatterlist that you are not using. i.e. it is no longer sufficient to simply set sg.address and sg.length, because junk might still be present in the new sg.page field, and pci_map_*() will BUG() if both sg.address and sg.page are non-zero.

True, perhaps we should add a init_sg or something like that.

Signature · 1 line
Jens Axboe
#3 lore raw

Re: SCSI tape crashes

Quoted 15 lines · David S. Miller

From: Jens Axboe <[email protected]>
Date: Wed, 31 Oct 2001 09:46:50 +0100

How is this different from my init_sg proposal? :-). The above looks fine to me, I just think it is important that we take care of this.

My impression was that you wanted to do something like:

	sgl = kmalloc();
	init_sg(sgl, nents);

	for_each_ent() {
		... existing code ..
	}
Quoted 2 lines

If what you really meant was semantically identicaly to what I have proposed, I'm completely in agreement with it. Please submit patches.

Yep, init_sg_entry is probably a better name... I'll hack up and submit soonish.

Signature · 1 line
Jens Axboe