From: Hou Tao houtao1@huawei.com
hulk inclusion category: bugfix bugzilla: 55097 CVE: NA
-------------------------------------------------
This reverts commit 375e23ab3d24e67b13df536dc6f933c628f78c41.
The patch set for partition symlink cleanup will introduce deadlock for nbd, loop and xen-blkfront driver, so revert it.
Signed-off-by: Hou Tao houtao1@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- block/genhd.c | 2 +- block/ioctl.c | 4 ---- block/partition-generic.c | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c index be938088c440f..1bf24be80cca9 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -782,7 +782,6 @@ void del_gendisk(struct gendisk *disk) bdev = bdget_disk(disk, 0); if (bdev) mutex_lock(&bdev->bd_mutex); - disk->flags &= ~GENHD_FL_UP; /* invalidate stuff */ disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY | DISK_PITER_REVERSE); @@ -798,6 +797,7 @@ void del_gendisk(struct gendisk *disk) invalidate_partition(disk, 0); bdev_unhash_inode(disk_devt(disk)); set_capacity(disk, 0); + disk->flags &= ~GENHD_FL_UP; up_write(&disk->lookup_sem);
if (!(disk->flags & GENHD_FL_HIDDEN)) diff --git a/block/ioctl.c b/block/ioctl.c index 3bcfc8dc32fad..899ffd50a7c6b 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -50,10 +50,6 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user return -EINVAL;
mutex_lock(&bdev->bd_mutex); - if (!(disk->flags & GENHD_FL_UP)) { - mutex_unlock(&bdev->bd_mutex); - return -ENXIO; - }
/* overlap? */ disk_part_iter_init(&piter, disk, diff --git a/block/partition-generic.c b/block/partition-generic.c index ddaa5d41139c6..63b82df5bbb40 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -525,9 +525,6 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) struct parsed_partitions *state = NULL; struct hd_struct *part; int p, highest, res; - - if (!(disk->flags & GENHD_FL_UP)) - return -ENXIO; rescan: if (state && !IS_ERR(state)) { free_partitions(state);