--- zzzz-none-000/linux-3.10.107/drivers/s390/block/dasd_genhd.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/s390/block/dasd_genhd.c 2021-02-04 17:41:59.000000000 +0000 @@ -87,7 +87,6 @@ { if (block->gdp) { del_gendisk(block->gdp); - block->gdp->queue = NULL; block->gdp->private_data = NULL; put_disk(block->gdp); block->gdp = NULL; @@ -100,15 +99,28 @@ int dasd_scan_partitions(struct dasd_block *block) { struct block_device *bdev; + int rc; bdev = bdget_disk(block->gdp, 0); - if (!bdev || blkdev_get(bdev, FMODE_READ, NULL) < 0) + if (!bdev) { + DBF_DEV_EVENT(DBF_ERR, block->base, "%s", + "scan partitions error, bdget returned NULL"); return -ENODEV; - /* - * See fs/partition/check.c:register_disk,rescan_partitions - * Can't call rescan_partitions directly. Use ioctl. - */ - ioctl_by_bdev(bdev, BLKRRPART, 0); + } + + rc = blkdev_get(bdev, FMODE_READ, NULL); + if (rc < 0) { + DBF_DEV_EVENT(DBF_ERR, block->base, + "scan partitions error, blkdev_get returned %d", + rc); + return -ENODEV; + } + + rc = blkdev_reread_part(bdev); + if (rc) + DBF_DEV_EVENT(DBF_ERR, block->base, + "scan partitions error, rc %d", rc); + /* * Since the matching blkdev_put call to the blkdev_get in * this function is not called before dasd_destroy_partitions