Re: [dm-devel] [PATCH 4/8] block: support delayed holder registration
From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-08-15 14:27:41
Also in:
dm-devel
On 8/15/21 12:07 AM, Christoph Hellwig wrote:
On Sat, Aug 14, 2021 at 02:13:09PM -0700, Guenter Roeck wrote:quoted
On Wed, Aug 04, 2021 at 11:41:43AM +0200, Christoph Hellwig wrote:quoted
device mapper needs to register holders before it is ready to do I/O. Currently it does so by registering the disk early, which can leave the disk and queue in a weird half state where the queue is registered with the disk, except for sysfs and the elevator. And this state has been a bit promlematic before, and will get more so when sorting out the responsibilities between the queue and the disk. Support registering holders on an initialized but not registered disk instead by delaying the sysfs registration until the disk is registered. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <redacted>This patch results in lockdep splats when booting from flash. Reverting it fixes the proboem.Should be fixed by: https://git.kernel.dk/cgit/linux-block/commit/?h=for-5.15/drivers&id=6e4df4c6488165637b95b9701cc862a42a3836ba
No, it doesn't. I could not apply this patch alone, so I applied the entire series on top of next-20210813 and gave it another try. f53c2d11ac98 (HEAD -> master) nbd: reduce the nbd_index_mutex scope f2f5254b356f nbd: refactor device search and allocation in nbd_genl_connect d5b03177e069 nbd: return the allocated nbd_device from nbd_dev_add 350b3f6a6e6b nbd: remove nbd_del_disk 49efbeb9de86 nbd: refactor device removal cdd920eb7cf2 nbd: do del_gendisk() asynchronously for NBD_DESTROY_ON_DISCONNECT 4b358aabb93a (tag: next-20210813, origin/master, origin/HEAD) Add linux-next specific files for 20210813 Still: ... [ 14.467748][ T1] Possible unsafe locking scenario: [ 14.467748][ T1] [ 14.467928][ T1] CPU0 CPU1 [ 14.468058][ T1] ---- ---- [ 14.468187][ T1] lock(&disk->open_mutex); [ 14.468317][ T1] lock(mtd_table_mutex); [ 14.468493][ T1] lock(&disk->open_mutex); [ 14.468671][ T1] lock(mtd_table_mutex); Guenter