Commit fbbec472 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Yongqiang Liu
Browse files

block: cleanup partition scanning in register_disk

mainline inclusion
from mainline-v5.10-rc1
commit 9301fe73
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6MRB5
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9301fe734384990ef9a2463cb7aeb3b00bf5dad5



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

Use blkdev_get_by_dev instead of open coding it using bdget_disk +
blkdev_get, and split the code to read the partition table into a
separate helper to make it a little more obvious.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>

Conflict:
 - this patch just factor out a helper, bdget_disk + blkdev_get is still
 used because 'bdev->bd_invalidated' need to be set.
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 33b040f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment