From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Horst Hummel <horst.hummel@de.ibm.com>
Subject: [PATCH 6/7] s390: dasd open counter.
Date: Wed, 18 Jan 2006 17:57:45 +0100 [thread overview]
Message-ID: <20060118165745.GF29266@osiris.boeblingen.de.ibm.com> (raw)
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
next reply other threads:[~2006-01-18 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-18 16:57 Heiko Carstens [this message]
2006-01-19 4:15 ` Andrew Morton
2006-01-19 4:16 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060118165745.GF29266@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=akpm@osdl.org \
--cc=horst.hummel@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®