Messages in this thread | | | From | Mikael Pettersson <> | Date | Thu, 29 Aug 2002 12:24:03 +0200 | Subject | Re: [PATCH] 2.5.32 floppy init and misc fixes |
| |
Mikolaj J. Habryn writes: > The floppy driver doesn't clean up it's register_sys_device if it fails > to init correctly. The below patch adds the appropriate > unregister_sys_device in the various failure paths, and also includes > Ewan MacMahon's one-liner for working VCs on devfs-only machines, and a > couple of missing #includes. Minimum required to get 2.5.32 working on > my Portege. ... > --- linux-2.5.32/drivers/block/floppy.c.orig 2002-08-29 16:17:30.000000000 +1000 > +++ linux-2.5.32/drivers/block/floppy.c 2002-08-29 16:19:20.000000000 +1000 > @@ -4235,6 +4235,7 @@ > devfs_handle = devfs_mk_dir (NULL, "floppy", NULL); > if (register_blkdev(MAJOR_NR,"fd",&floppy_fops)) { > printk("Unable to get major %d for floppy\n",MAJOR_NR); > + unregister_sys_device(&device_floppy); > return -EBUSY; > } > etc.
Floppy has many more problems. Repeadedly loading and unloading the floppy.o module corrupts sys_device data structures. Writing to floppy can give ENOSPC errors even though space exists. Writing to floppy can OOPS the kernel due to a NULL pointer error. VFS-over-floppy corrupts data since 2.5.13. Putting lilo on ext2 on floppy can cause a kernel hang due to an infinite loop of "buffer layer error".
I have a patch which fixes the {,un}register_sys_device() bugs, NULL queue bug, zero i_size bug, and fixes read/write enough that raw media access (e.g. tar or dd to/from /dev/fd0) works. It's in the 2.5-dj tree, and separately in <http://www.csd.uu.se/~mikpe/linux/patches/2.5/>.
I havent' pushed this to Linus since it's meaningless as long as the VFS data corruption exists. It was broken by blkdev/VFS changes, but those responsible haven't yet bothered to repair it.
/Mikael - 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/
| |