OSDN Git Service

throttle-groups: Don't allow timers without throttled requests
authorAlberto Garcia <berto@igalia.com>
Thu, 2 Aug 2018 14:50:26 +0000 (17:50 +0300)
committerKevin Wolf <kwolf@redhat.com>
Wed, 15 Aug 2018 10:50:39 +0000 (12:50 +0200)
commit25b8e4db7f3baca47244ccd945eb62b32a6e2019
tree7bacf36596dc3aba9021987929993826d1d6029b
parent3db3e9c621519cbfc2b52e98b38f13ad863c0062
throttle-groups: Don't allow timers without throttled requests

Commit 6fccbb475bc6effc313ee9481726a1748b6dae57 fixed a bug caused by
QEMU attempting to remove a throttle group member with no pending
requests but an active timer set. This was the result of a previous
bdrv_drained_begin() call processing the throttled requests but
leaving the timer untouched.

Although the commit does solve the problem, the situation shouldn't
happen in the first place. If we try to drain a throttle group member
which has a timer set, we should cancel the timer instead of ignoring
it.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/throttle-groups.c