]> git.baikalelectronics.ru Git - kernel.git/commit
blk-cgroup: fix missing put device in error path from blkg_conf_pref()
authorYu Kuai <yukuai3@huawei.com>
Tue, 2 Nov 2021 02:07:05 +0000 (10:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:41 +0000 (09:48 +0100)
commitf2c08e741a708dfddb6dbc083d254aa86f32bc73
treed68feb2286dc25a556387b27681083dd468a1a3c
parente1df81e61abc13b926b52782c678d5287b0e0287
blk-cgroup: fix missing put device in error path from blkg_conf_pref()

[ Upstream commit fdbf7832a77b904f19c9a7094c8afd84c70fa2d1 ]

If blk_queue_enter() failed due to queue is dying, the
blkdev_put_no_open() is needed because blkcg_conf_open_bdev() succeeded.

Fixes: 4d3f699bc0be ("blk-cgroup: synchronize blkg creation against policy deactivation")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20211102020705.2321858-1-yukuai3@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-cgroup.c