From: James S. <jsi...@us...> - 2001-10-15 01:13:20
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/block In directory usw-pr-cvs1:/tmp/cvs-serv1198/drivers/block Modified Files: genhd.c Log Message: Synced to 2.4.12 Index: genhd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/block/genhd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- genhd.c 2001/10/06 16:11:13 1.6 +++ genhd.c 2001/10/15 01:13:17 1.7 @@ -47,9 +47,27 @@ void add_gendisk(struct gendisk *gp) { + struct gendisk *sgp; + write_lock(&gendisk_lock); + + /* + * In 2.5 this will go away. Fix the drivers who rely on + * old behaviour. + */ + + for (sgp = gendisk_head; sgp; sgp = sgp->next) + { + if (sgp == gp) + { +// printk(KERN_ERR "add_gendisk: device major %d is buggy and added a live gendisk!\n", +// sgp->major) + goto out; + } + } gp->next = gendisk_head; gendisk_head = gp; +out: write_unlock(&gendisk_lock); } |