From: Stefan Haberland <sth@linux.ibm.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org,
Jan Hoeppner <hoeppner@linux.ibm.com>,
linux-s390@vger.kernel.org,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [PATCH v2 06/10] s390/dasd: Store path configuration data during path handling
Date: Thu, 8 Oct 2020 15:13:32 +0200 [thread overview]
Message-ID: <20201008131336.61100-7-sth@linux.ibm.com> (raw)
In-Reply-To: <20201008131336.61100-1-sth@linux.ibm.com>
From: Jan Höppner <hoeppner@linux.ibm.com>
Currently, the configuration data for a path is retrieved during a path
verification and used only temporarily. If a path is newly added to the
I/O setup after a boot, no configuration data will be stored for this
particular path.
However, this data is required for later use and should be present for
a valid I/O path anyway. Store this data during the path verification so
that newly added paths can provide all information necessary.
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
[sth@linux.ibm.com: fix conf_data memleak]
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
---
drivers/s390/block/dasd_eckd.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 497aa81778b6..3ff7b532a5bf 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1007,6 +1007,11 @@ static void dasd_eckd_store_conf_data(struct dasd_device *device,
struct subchannel_id sch_id;
ccw_device_get_schid(device->cdev, &sch_id);
+ /*
+ * path handling and read_conf allocate data
+ * free it before replacing the pointer
+ */
+ kfree(device->path[chp].conf_data);
device->path[chp].conf_data = conf_data;
device->path[chp].cssid = sch_id.cssid;
device->path[chp].ssid = sch_id.ssid;
@@ -1263,9 +1268,10 @@ static void do_path_verification_work(struct work_struct *work)
struct dasd_uid *uid;
__u8 path_rcd_buf[DASD_ECKD_RCD_DATA_SIZE];
__u8 lpm, opm, npm, ppm, epm, hpfpm, cablepm;
+ struct dasd_conf_data *conf_data;
unsigned long flags;
char print_uid[60];
- int rc;
+ int rc, pos;
data = container_of(work, struct path_verification_work_data, worker);
device = data->device;
@@ -1395,6 +1401,14 @@ static void do_path_verification_work(struct work_struct *work)
}
}
+ conf_data = kzalloc(DASD_ECKD_RCD_DATA_SIZE, GFP_KERNEL);
+ if (conf_data) {
+ memcpy(conf_data, data->rcd_buffer,
+ DASD_ECKD_RCD_DATA_SIZE);
+ }
+ pos = pathmask_to_pos(lpm);
+ dasd_eckd_store_conf_data(device, conf_data, pos);
+
/*
* There is a small chance that a path is lost again between
* above path verification and the following modification of
--
2.17.1
next prev parent reply other threads:[~2020-10-08 13:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 13:13 [PATCH v2 00/10] DASD FC endpoint security Stefan Haberland
2020-10-08 13:13 ` [PATCH v2 01/10] s390/cio: Export information about Endpoint-Security Capability Stefan Haberland
2020-10-08 13:13 ` [PATCH v2 02/10] s390/cio: Provide Endpoint-Security Mode per CU Stefan Haberland
2020-10-08 13:13 ` [PATCH v2 03/10] s390/cio: Add support for FCES status notification Stefan Haberland
2020-10-08 13:13 ` [PATCH v2 04/10] s390/dasd: Remove unused parameter from dasd_generic_probe() Stefan Haberland
2020-10-08 14:13 ` Cornelia Huck
2020-10-08 13:13 ` [PATCH v2 05/10] s390/dasd: Move duplicate code to separate function Stefan Haberland
2020-10-08 14:16 ` Cornelia Huck
2020-10-08 13:13 ` Stefan Haberland [this message]
2020-10-08 14:21 ` [PATCH v2 06/10] s390/dasd: Store path configuration data during path handling Cornelia Huck
2020-10-08 13:13 ` [PATCH v2 07/10] s390/dasd: Fix operational path inconsistency Stefan Haberland
2020-10-08 14:37 ` Cornelia Huck
2020-10-08 13:13 ` [PATCH v2 08/10] s390/dasd: Display FC Endpoint Security information via sysfs Stefan Haberland
2020-10-08 14:43 ` Cornelia Huck
2020-10-08 13:13 ` [PATCH v2 09/10] s390/dasd: Prepare for additional path event handling Stefan Haberland
2020-10-08 14:48 ` Cornelia Huck
2020-10-08 13:13 ` [PATCH v2 10/10] s390/dasd: Process FCES path event notification Stefan Haberland
2020-10-08 14:54 ` Cornelia Huck
2020-10-08 14:56 ` Jan Höppner
2020-10-12 19:06 ` [PATCH v2 00/10] DASD FC endpoint security Stefan Haberland
2020-10-12 19:33 ` Jens Axboe
2020-10-12 19:50 ` Stefan Haberland
2020-10-13 19:40 ` Jens Axboe
2020-10-13 20:15 ` Stefan Haberland
2020-10-14 1:19 ` Jens Axboe
2020-11-10 15:50 ` Stefan Haberland
2020-11-11 16:20 ` Jens Axboe
2020-11-12 13:27 ` Stefan Haberland
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=20201008131336.61100-7-sth@linux.ibm.com \
--to=sth@linux.ibm.com \
--cc=axboe@kernel.dk \
--cc=borntraeger@de.ibm.com \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hoeppner@linux.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).