[RFT][PATCH] IDE devfs fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Anybody using devfs + modular IDE support?  If so please test, thanks.

[PATCH] IDE devfs fixes

* don't remove drive->devfs_name in drive_release_dev(), this should
  fix OOPS for ide-floppy driver (drive->devfs_name is already removed
  by del_gendisk()) and ide-{cd,floppy,tape} drivers (drive->devfs_name
  is not registered et all)
* remove workaround for the above bug from ide-disk driver (which probably
  caused devfs support to brake if ide-disk module was reloaded)
* remove dead code from ide_unregister() (drive->devfs_name is only set
  if drive->present == 1)

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>

Index: ide-2.6.git/drivers/ide/ide-disk.c
===================================================================
--- ide-2.6.git.orig/drivers/ide/ide-disk.c
+++ ide-2.6.git/drivers/ide/ide-disk.c
@@ -1048,7 +1048,6 @@ static void ide_disk_release(struct kref
 	struct gendisk *g = idkp->disk;

 	drive->driver_data = NULL;
-	drive->devfs_name[0] = '\0';
 	g->private_data = NULL;
 	put_disk(g);
 	kfree(idkp);
Index: ide-2.6.git/drivers/ide/ide-probe.c
===================================================================
--- ide-2.6.git.orig/drivers/ide/ide-probe.c
+++ ide-2.6.git/drivers/ide/ide-probe.c
@@ -1308,10 +1308,6 @@ static void drive_release_dev (struct de
 	ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);

 	spin_lock_irq(&ide_lock);
-	if (drive->devfs_name[0] != '\0') {
-		devfs_remove(drive->devfs_name);
-		drive->devfs_name[0] = '\0';
-	}
 	ide_remove_drive_from_hwgroup(drive);
 	if (drive->id != NULL) {
 		kfree(drive->id);
Index: ide-2.6.git/drivers/ide/ide.c
===================================================================
--- ide-2.6.git.orig/drivers/ide/ide.c
+++ ide-2.6.git/drivers/ide/ide.c
@@ -593,13 +593,8 @@ void ide_unregister(unsigned int index)
 		goto abort;
 	for (unit = 0; unit < MAX_DRIVES; ++unit) {
 		drive = &hwif->drives[unit];
-		if (!drive->present) {
-			if (drive->devfs_name[0] != '\0') {
-				devfs_remove(drive->devfs_name);
-				drive->devfs_name[0] = '\0';
-			}
+		if (!drive->present)
 			continue;
-		}
 		spin_unlock_irq(&ide_lock);
 		device_unregister(&drive->gendev);
 		down(&drive->gendev_rel_sem);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux