]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
block, bfq: get extra ref to prevent a queue from being freed during a group move
authorPaolo Valente <paolo.valente@linaro.org>
Mon, 3 Feb 2020 10:40:56 +0000 (11:40 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 12 Mar 2020 17:01:52 +0000 (18:01 +0100)
commit5ba301c7a7a3712a8ff5de8376783b6606370d5d
tree1403b7d726a9e6ab64bead84f936d34de3d151c7
parenta4f35b55d91d12dd644283eb177aafad05927c37
block, bfq: get extra ref to prevent a queue from being freed during a group move

BugLink: https://bugs.launchpad.net/bugs/1867178
[ Upstream commit ecedd3d7e19911ab8fe42f17b77c0a30fe7f4db3 ]

In bfq_bfqq_move(), the bfq_queue, say Q, to be moved to a new group
may happen to be deactivated in the scheduling data structures of the
source group (and then activated in the destination group). If Q is
referred only by the data structures in the source group when the
deactivation happens, then Q is freed upon the deactivation.

This commit addresses this issue by getting an extra reference before
the possible deactivation, and releasing this extra reference after Q
has been moved.

Tested-by: Chris Evich <cevich@redhat.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
block/bfq-cgroup.c