提交 9dee6a09 编写于 作者: H Hou Tao 提交者: Yang Yingliang

Revert "block: take bd_mutex around delete_partitions in del_gendisk"

hulk inclusion
category: bugfix
bugzilla: 55097
CVE: NA

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

This reverts commit 10097449.

The patch set for partition symlink cleanup will introduce
deadlock for nbd, loop and xen-blkfront driver, so revert it.
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5443c0b4
...@@ -764,7 +764,6 @@ void del_gendisk(struct gendisk *disk) ...@@ -764,7 +764,6 @@ void del_gendisk(struct gendisk *disk)
{ {
struct disk_part_iter piter; struct disk_part_iter piter;
struct hd_struct *part; struct hd_struct *part;
struct block_device *bdev;
blk_integrity_del(disk); blk_integrity_del(disk);
disk_del_events(disk); disk_del_events(disk);
...@@ -774,14 +773,6 @@ void del_gendisk(struct gendisk *disk) ...@@ -774,14 +773,6 @@ void del_gendisk(struct gendisk *disk)
* disk is marked as dead (GENHD_FL_UP cleared). * disk is marked as dead (GENHD_FL_UP cleared).
*/ */
down_write(&disk->lookup_sem); down_write(&disk->lookup_sem);
/*
* If bdev is null, that menas memory allocate fail. Then
* add_partitions can also fail.
*/
bdev = bdget_disk(disk, 0);
if (bdev)
mutex_lock(&bdev->bd_mutex);
/* invalidate stuff */ /* invalidate stuff */
disk_part_iter_init(&piter, disk, disk_part_iter_init(&piter, disk,
DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE); DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE);
...@@ -791,8 +782,6 @@ void del_gendisk(struct gendisk *disk) ...@@ -791,8 +782,6 @@ void del_gendisk(struct gendisk *disk)
delete_partition(disk, part->partno); delete_partition(disk, part->partno);
} }
disk_part_iter_exit(&piter); disk_part_iter_exit(&piter);
if (bdev)
mutex_unlock(&bdev->bd_mutex);
invalidate_partition(disk, 0); invalidate_partition(disk, 0);
bdev_unhash_inode(disk_devt(disk)); bdev_unhash_inode(disk_devt(disk));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册