Re: [bug report] dm: 'tried to init an initialized object' error triggered during device creation

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

 



Hi,

在 2025/07/31 9:28, Hou Tao 写道:
cc +linux-block

The disk->queue_kobj is initialized in add_disk() and is uninitialized
in del_disk(). And it seems that blk_unregister_queue() in del_disk()
doesn't uninitialize the queue_kobj completely, because it doesn't
expect the queue_kobj will be added again. I think the right place to
fix the problem is blk_unregister_queue(). How about just memset the
queue_kobj as zero after deleting the queue_kobj in blk_unregister_queue() ?

I think it's better to move kobject_init to allocate disk:

1) alloc disk, kobject_init
2) register q, kobject_add
3) unregister q, kobject_del
4) free disk, kobject_put

With this, it's safe to add the kobject again.

Thanks,
Kuai





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux