mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 6/7] s390: dasd open counter.
@ 2006-01-18 16:57 Heiko Carstens
  2006-01-19  4:15 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2006-01-18 16:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Martin Schwidefsky, Horst Hummel

From: Horst Hummel <horst.hummel@de.ibm.com>

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 <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-19  4:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-18 16:57 [PATCH 6/7] s390: dasd open counter Heiko Carstens
2006-01-19  4:15 ` Andrew Morton
2006-01-19  4:16   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome