From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: 55097 https://gitee.com/openeuler/kernel/issues/I4DDEL
-------------------------------------------------
This reverts commit 5ff55bd87e0c5a1f7ca9c802b73368ea1cfa282f.
The patch set for partition symlink cleanup will introduce deadlock for nbd, loop and xen-blkfront driver, so revert it.
Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- block/genhd.c | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c index b6e7c00c384a..6566eacc807d 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -901,7 +901,6 @@ void del_gendisk(struct gendisk *disk) { struct disk_part_iter piter; struct hd_struct *part; - struct block_device *bdev;
might_sleep();
@@ -913,13 +912,6 @@ void del_gendisk(struct gendisk *disk) * disk is marked as dead (GENHD_FL_UP cleared). */ down_write(&disk->lookup_sem); - /* - * If bdev is null, that means memory allocate fail. Then - * add_partitions can also fail. - */ - bdev = bdget_disk(disk, 0); - if (bdev) - mutex_lock(&bdev->bd_mutex); /* invalidate stuff */ disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE); @@ -928,10 +920,6 @@ void del_gendisk(struct gendisk *disk) delete_partition(part); } disk_part_iter_exit(&piter); - if (bdev) { - mutex_unlock(&bdev->bd_mutex); - bdput(bdev); - }
invalidate_partition(disk, 0); set_capacity(disk, 0);