2.5.70 add_disk(disk) re-registering disk->queue->elevator.kobj (bug?!)

Lou Langholtz
2003-06-03T18:20:31Z

What am I missing (or is something in the block handling code actually
seriously wrong)?

In linux-2.5.70/drivers/block/genhd.c the add_disk(disk) logic seems
wrong because if disk->queue is shared by a few disk's, then that shared
queue's elevator is re-registered via the call to
elv_register_queue(disk) which calls down to
kobject_register(disk->queue->elevator.kobj). Or perhaps the block
handling logic was changed such that disks don't share the same
request_queue anymore. If so, then a few drivers (like nbd) need to be
updated to use a seperate request_queue per disk. If the block handling
code wasn't however changed this way though and struct gendisk objects
can still share the same request_queue then it seems a lot of other
logic todo with elv_register_queue() is also scrogged. Like shouldn't
disk->kobj.parent be set to kobject_get(&disk->queue->elevator.kobj)
instead of the reverse that the 2.5.70 code does? If so, then all the
deallocation code (called from del_gendisk(disk)) needs to be reversed
and changed around too. Seems like so much wrong logic that it's my
reading of the code that's at fault instead. Help!?

CC me on any email as I don't read the lkml regularly. ldl@aros.net

Thanks!!

Louis D. Langholtz