diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 74ed5f4dd5e..fafeeae5267 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -421,8 +421,15 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) dasd_info->cu_model = cdev->id.cu_model; dasd_info->dev_type = cdev->id.dev_type; dasd_info->dev_model = cdev->id.dev_model; - dasd_info->open_count = atomic_read(&device->open_count); dasd_info->status = device->state; + /* + * The open_count is increased for every opener, that includes + * the blkdev_get in dasd_scan_partitions. + * This must be hidden from user-space. + */ + dasd_info->open_count = atomic_read(&device->open_count); + if (!device->bdev) + dasd_info->open_count++; /* * check if device is really formatted |