[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <09e676c5-8407-a0a6-313c-22fcfee4e488@huaweicloud.com>
Date: Thu, 31 Jul 2025 09:49:27 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Hou Tao <houtao@...weicloud.com>, Li Lingfeng <lilingfeng3@...wei.com>,
agk@...hat.com, Mike Snitzer <snitzer@...nel.org>,
Mikulas Patocka <mpatocka@...hat.com>, dm-devel@...ts.linux.dev,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-block@...r.kernel.org
Cc: zhengqixing@...wei.com, yangerkun <yangerkun@...wei.com>,
"zhangyi (F)" <yi.zhang@...wei.com>,
"chengzhihao1@...wei.com" <chengzhihao1@...wei.com>,
Li Lingfeng <lilingfeng@...weicloud.com>, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [bug report] dm: 'tried to init an initialized object' error
triggered during device creation
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
Powered by blists - more mailing lists