block: support delayed holder registration
authorChristoph Hellwig <hch@lst.de>
Wed, 4 Aug 2021 09:41:43 +0000 (11:41 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Aug 2021 17:50:42 +0000 (11:50 -0600)
commitd626338735909bc2b2e7cafc332f44ed41cfdeee
tree44449bb3fd601e4fbd630928ce20284e76469e3e
parent0dbcfe247f22a6d73302dfa691c48b3c14d31c4c
block: support delayed holder registration

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 <snitzer@redhat.com>
Link: https://lore.kernel.org/r/20210804094147.459763-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
block/holder.c
include/linux/genhd.h