Re: [BUG 2.6.17-git] kmem_cache_create: duplicate cache scsi_cmd_cache

Linus Torvalds
2006-05-12T23:50:44Z

On Sat, 13 May 2006, Al Viro wrote:
>
> BTW, the best option is to kill bdev_uevent() again. Short of that,
> skip PHYSDEV mess if disk doesn't have GENHD_FL_UP.

I do think the mount/umount events are valid and interesting, so I'd much
rather see the second version.

However, that does beg the question: wouldn't that effectively be what the
patch I posted would do? Notably the "disk->driverfs_dev = NULL" part
after we've dropped it (the "KOBJ_REMOVE" event move is a separate issue,
mixed here into the same patch, but should result in possibly better name
generation for the event).

Basically, onces driverfs_dev has been dropped, we NULL it out, and then
the people who use it automatically get the right result.

Yes? No? "You're a total klutz, Linus, that patch won't actually do
anything, because <xyz>"?

Linus

---
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 45ae7dd..7ef1f09 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -533,6 +533,7 @@ void del_gendisk(struct gendisk *disk)

devfs_remove_disk(disk);

+ kobject_uevent(&disk->kobj, KOBJ_REMOVE);
if (disk->holder_dir)
kobject_unregister(disk->holder_dir);
if (disk->slave_dir)
@@ -545,7 +546,7 @@ void del_gendisk(struct gendisk *disk)
kfree(disk_name);
}
put_device(disk->driverfs_dev);
+ disk->driverfs_dev = NULL;
}
- kobject_uevent(&disk->kobj, KOBJ_REMOVE);
kobject_del(&disk->kobj);
}