Commit f392c8ed authored by Yu Kuai's avatar Yu Kuai Committed by Zheng Zengkai
Browse files

block: fix regression for dm

hulk inclusion
category: bugfix
bugzilla: 187345, https://gitee.com/openeuler/kernel/issues/I5L5ZG


CVE: NA

--------------------------------

Commit d7c2ddc8 ("block: fix that part scan is disabled in
device_add_disk()") introduce a regression:

Test procedures:
dmsetup create test --notable
dmsetup remove test

Test result:
dmsetup will stuck forever

Root cause:
before:
1) dmsetup creat
    add_disk_add_disk_no_queue_reg()
     scan partitions
     uevent
2) blk_register_queue -> notable will not call this
3) dmsetup remove
    wait for uevent

after:
1) dmsetup creat
    add_disk_add_disk_no_queue_reg()
2) blk_register_queue() -> notable will not call this
    scan_partitions
    uevent
3) dmsetup remove
    wait for uevent -> impossible for notable

Fix the problem by moving scan_partitions and uevent from
blk_register_queue() to the end of add_disk_add_disk_no_queue_reg().

Fixes: d7c2ddc8 ("block: fix that part scan is disabled in device_add_disk()")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c26ea58d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment