]> git.baikalelectronics.ru Git - kernel.git/commit
block: add a flag to make put_disk on partially initalized disks safer
authorChristoph Hellwig <hch@lst.de>
Fri, 21 May 2021 05:50:54 +0000 (07:50 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Jun 2021 13:42:23 +0000 (07:42 -0600)
commit4052432465f62f648d750b0f53f59425ac450daf
tree95e14b94cb882656a3337f78f19102f305c1b515
parent608363e43fdbe95b22cc475f6b1da45f58db4cbe
block: add a flag to make put_disk on partially initalized disks safer

Add a flag to indicate that __device_add_disk did grab a queue reference
so that disk_release only drops it if we actually had it.  This sort
out one of the major pitfals with partially initialized gendisk that
a lot of drivers did get wrong or still do.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20210521055116.1053587-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
include/linux/genhd.h