Message ID | 69a2465f-dd67-6962-4f15-57fa9cbafe4d@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 4a181fc..5ecdb9f 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1510,6 +1510,11 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) if (bdev->bd_bdi == &noop_backing_dev_info) bdev->bd_bdi = bdi_get(disk->queue->backing_dev_info); } else { + if (bdev->bd_disk != disk) { + ret = -ENXIO; + goto out_unlock_bdev; + } + if (bdev->bd_contains == bdev) { ret = 0; if (bdev->bd_disk->fops->open)