From: Horst Hummel <[email protected]>
The open_count is increased for every opener, that includes the
blkdev_get in dasd_scan_partitions. This tampers the open_count
in BIODASDINFO. Hide the internal open from user-space.
Signed-off-by: Horst Hummel <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
---
drivers/s390/block/dasd_ioctl.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletion(-)
diff -urpN linux-2.6/drivers/s390/block/dasd_ioctl.c linux-2.6-patched/drivers/s390/block/dasd_ioctl.c
--- linux-2.6/drivers/s390/block/dasd_ioctl.c 2006-01-18 17:25:49.000000000 +0100
+++ linux-2.6-patched/drivers/s390/block/dasd_ioctl.c 2006-01-18 17:25:53.000000000 +0100
@@ -421,8 +421,15 @@ dasd_ioctl_information(struct block_devi
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]