]> git.baikalelectronics.ru Git - kernel.git/commit
block: release disk reference in hd_struct_free_work
authorMing Lei <ming.lei@redhat.com>
Tue, 1 Sep 2020 10:07:38 +0000 (18:07 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Sep 2020 14:34:08 +0000 (08:34 -0600)
commit2da53cc4b9ff0b03faf8ad984a7c5492f5cf3ec1
treeaf141eea39609d18694bc3a9f8531ce53c8c3254
parent73abdcff0a612cc498f0c53857c4225f5a2fd8f9
block: release disk reference in hd_struct_free_work

Commit 04545fc8c1bf ("block: revert back to synchronous request_queue removal")
stops to release request queue from wq context because that commit
supposed all blk_put_queue() is called in context which is allowed
to sleep. However, this assumption isn't true because we release disk's
reference in partition's percpu_ref's ->release() which doesn't allow
to sleep, because the ->release() is run via call_rcu().

Fixes this issue by moving put disk reference into hd_struct_free_work()

Fixes: 04545fc8c1bf ("block: revert back to synchronous request_queue removal")
Reported-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/core.c