]> git.baikalelectronics.ru Git - kernel.git/commit
iocost: don't nest spin_lock_irq in ioc_weight_write()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 31 Oct 2019 10:53:41 +0000 (13:53 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Oct 2019 17:40:57 +0000 (11:40 -0600)
commitc81f3df68ac241d780e3156eac41c63d2e25169e
treeab2f925a8b59d0ac98b77a1c763e5649afa37241
parent72db2846ce78c95e49e0b2f8a0b1cd71cc41756e
iocost: don't nest spin_lock_irq in ioc_weight_write()

This code causes a static analysis warning:

    block/blk-iocost.c:2113 ioc_weight_write() error: double lock 'irq'

We disable IRQs in blkg_conf_prep() and re-enable them in
blkg_conf_finish().  IRQ disable/enable should not be nested because
that means the IRQs will be enabled at the first unlock instead of the
second one.

Fixes: fe734d3093a8 ("blkcg: implement blk-iocost")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c