[lkml]   [2002]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectPatch: linux-2.5.34/drivers/ide/ide.c was building list of drives in reverse order
	ata_attach in linux-2.5.34/drivers/ide/ide.c builds a list of
IDE drives that do not yet have a device driver bound to them, in case
ide-disk, ide-scsi, or whatever driver you want to use is not loaded

The problem was that ata_attach was adding to the head of
the list, so the list was being built in reverse order. So, if
you had two IDE disks, and ide-disk was a loadable module, the
devfs entries for the disks would be numbered in reverse (the
first disk would be /dev/discs/disc1, and the second would be

The follow patch fixes the problem by changing the relevant
list_add to list_add_tail. Incidentally, the generic code
in drivers/base/ already does it this way.

Adam J. Richter __ ______________ 575 Oroville Road \ / Milpitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America
"Free Software For The Rest Of Us."
--- linux-2.5.34/drivers/ide/ide.c 2002-09-09 10:35:06.000000000 -0700
+++ linux/drivers/ide/ide.c 2002-09-12 04:30:20.000000000 -0700
@@ -2478,11 +2478,11 @@
if (driver->owner)
- list_add(&drive->list, &ata_unused);
+ list_add_tail(&drive->list, &ata_unused);
return 1;

static int ide_ioctl (struct inode *inode, struct file *file,
 \ /
  Last update: 2005-03-22 13:28    [W:0.037 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site