• C
    bcache: acquire bch_register_lock later in cached_dev_detach_finish() · 97ba3b81
    Coly Li 提交于
    Now there is variable bcache_is_reboot to prevent device register or
    unregister during reboot, it is unncessary to still hold mutex lock
    bch_register_lock before stopping writeback_rate_update kworker and
    writeback kthread. And if the stopping kworker or kthread holding
    bch_register_lock inside their routine (we used to have such problem
    in writeback thread, thanks to Junhui Wang fixed it), it is very easy
    to introduce deadlock during reboot/shutdown procedure.
    
    Therefore in this patch, the location to acquire bch_register_lock is
    moved to the location before calling calc_cached_dev_sectors(). Which
    is later then original location in cached_dev_detach_finish().
    Signed-off-by: NColy Li <colyli@suse.de>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    97ba3b81
super.c 65.3 KB